https://github.com/mvz/gnome_app_driver
Test Ruby-GNOME2 applications using Atspi
https://github.com/mvz/gnome_app_driver
gnome hacktoberfest ruby ruby-gnome2
Last synced: 11 months ago
JSON representation
Test Ruby-GNOME2 applications using Atspi
- Host: GitHub
- URL: https://github.com/mvz/gnome_app_driver
- Owner: mvz
- License: mit
- Created: 2017-11-05T13:22:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-09T10:45:09.000Z (over 1 year ago)
- Last Synced: 2024-12-01T16:36:11.989Z (over 1 year ago)
- Topics: gnome, hacktoberfest, ruby, ruby-gnome2
- Language: Ruby
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Ruby-GNOME2 App Driver
Test driver for Ruby-GNOME2 applications using Atspi. Takes care of boot and
shutdown, and provides a handle on the GUI's main UI frame.
## Usage
This driver assumes your application lives in `bin/` and uses additional ruby
code in `lib/`.
Say, your application is called `foo`. Then, in your tests, do something like this:
```ruby
require 'gnome_app_driver'
describe 'The application' do
before do
@driver = GnomeAppDriver.new('foo')
# This will boot `ruby -Ilib bin/foo`, wait for its main window to appear,
# and focus it.
@driver.boot
end
it 'does stuff' do
# Fetch the main window's atspi object
frame = @driver.frame
# You can now interact with the window's objects
# Select item matching /bar/ from combo box:
box = frame.find_role :combo_box
item = box.find_role :menu_item, /bar/
box.get_action_name(0).must_equal 'press'
box.do_action 0
item.get_action_name(0).must_equal 'click'
item.do_action 0
# Fetch contents of a text box
textbox = frame.find_role :text
textbox.get_text(0, 100).must_equal 'Foo bar baz'
# Quit application
menu_item = frame.find_role :menu_item, /Quit/
menu_item.do_action 0
# Check exit status
status = @driver.cleanup
status.exitstatus.must_equal 0
end
after do
# Ensure application is cleaned up
@driver.cleanup
end
end
```
## Installation
```
gem install gnome_app_driver
```
## Dependencies
Ruby-GNOME2 App Driver depends on the `gobject-introspection` gem. It also
requires Ruby 3.0 or higher.
## Contributing
Contributions are welcome! Please feel free to create issues or pull requests
on GitHub.
## License
Copyright © 2015-2024 [Matijs van Zuijlen](http://www.matijs.net).
See LICENSE for details.