Skip to content

Add uiautomat[ion|or] locators #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/appium_lib/android/mobile_methods.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Appium::Android
class << self
# @!method uiautomator_find
# find_element/s can be used with a [UISelector](http://developer.android.com/tools/help/uiautomator/UiSelector.html).
#
# ```ruby
# find_elements :uiautomator, 'new UiSelector().clickable(true)'
# ```
def extended(mod)
Selenium::WebDriver::SearchContext.class_eval do
Selenium::WebDriver::SearchContext::FINDERS[:uiautomator] = '-android uiautomator'
end
end
end
end
2 changes: 2 additions & 0 deletions lib/appium_lib/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ module Appium
require_relative 'ios/element/alert'
require_relative 'ios/element/generic'
require_relative 'ios/element/textfield'
require_relative 'ios/mobile_methods'

# android
require_relative 'android/dynamic'
Expand All @@ -141,6 +142,7 @@ module Appium
require_relative 'android/element/alert'
require_relative 'android/element/generic'
require_relative 'android/element/textfield'
require_relative 'android/mobile_methods'

# device methods
require_relative 'device/device'
Expand Down
15 changes: 15 additions & 0 deletions lib/appium_lib/ios/mobile_methods.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Appium::Ios
class << self
# @!method uiautomation_find
# find_element/s can be used with a [UIAutomation command](https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAWindowClassReference/UIAWindow/UIAWindow.html#//apple_ref/doc/uid/TP40009930).
#
# ```ruby
# find_elements :uiautomation, 'elements()
# ```
def extended(mod)
Selenium::WebDriver::SearchContext.class_eval do
Selenium::WebDriver::SearchContext::FINDERS[:uiautomation] = '-ios uiautomation'
end
end
end
end