No release in over a year
Driver to test the UI of applications using Ruby-GNOME2 by interacting with them via Atspi.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 3.2, < 5.0
~> 5.12
~> 13.0
~> 1.76

Runtime

 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:

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.2 or higher.

Contributing

Contributions are welcome! Please feel free to create issues or pull requests on GitHub.

License

Copyright © 2015-2025 Matijs van Zuijlen. See LICENSE for details.