Skip to content

Commit

Permalink
Add textfield_named for iOS
Browse files Browse the repository at this point in the history
Fix #100
  • Loading branch information
bootstraponline committed Nov 22, 2013
1 parent 789fc52 commit e6da4aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/appium_lib/ios/element/textfield.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@ def textfield_include text
def textfield_exact text
xpath "textfield[@text='#{text}']"
end

# Get the first textfield that exactly matches name
# @return [Element]
def textfield_named target_name
wait do
target = e_textfields.detect { |e| e.name == target_name }
raise "Textfield named #{target_name} not found" unless target
target
end
end
end # module Appium::Ios
2 changes: 2 additions & 0 deletions lib/appium_lib/ios/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def id id
find_element :id, id
end

# Return the iOS version as an array of integers
# @return [Array<Integer>]
def ios_version
ios_version = execute_script 'UIATarget.localTarget().systemVersion()'
ios_version.split('.').map { |e| e.to_i }
Expand Down

0 comments on commit e6da4aa

Please sign in to comment.