Last active
August 29, 2015 13:56
-
-
Save leviwilson/8825039 to your computer and use it in GitHub Desktop.
mohawk / uia gem setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mohawk' | |
require 'rspec-expectations' | |
require 'childprocess' | |
World(Mohawk::Navigation) | |
Mohawk.default_adapter = Mohawk::Adapters::UiaAdapter # use uia rather than RAutomation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
# ... | |
gem 'mohawk', git: 'git://github.com/leviwilson/mohawk.git', branch: 'uia_gem' | |
gem 'uia', git: 'git://github.com/northwoodspd/uia.git' | |
# ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mohawk' | |
Mohawk.default_adapter = Mohawk::Adapters::UiaAdapter | |
Mohawk.app_path = './TelerikWpfApp1.exe' | |
Mohawk.start | |
class MainWindow | |
include Mohawk | |
window(title: /MainWindow/) | |
menu_item(:subitem_one, path: ['Item 1', 'Sub Item 1']) | |
end | |
main = MainWindow.new | |
main.click_subitem_one | |
main.subitem_one # fails, because of the modal dialog | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll want to
gem update mohawk
as I had to add theclick_#{menu_item}
accessor to mouse click rather than select. Select causes an issue if theInvoke
on the menu item doesn't return immediately. In this case, because of a modal dialog (see the Notes here).