appium_lib 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,11 @@ module Appium::Common
41
41
  result
42
42
  end
43
43
 
44
+ # Return block.call and ignore any exceptions.
45
+ def ignore &block
46
+ begin; block.call; rescue; end
47
+ end
48
+
44
49
  # Check every 0.5 seconds to see if block.call returns true. nil is considered a failure.
45
50
  # Give up after 30 seconds.
46
51
  # @param max_wait [Integer] the maximum time in seconds to wait for
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Appium
3
3
  # Version and Date are defined on the 'Appium' module, not 'Appium::Common'
4
- VERSION = '0.5.4' unless defined? ::Appium::VERSION
5
- DATE = '2013-05-28' unless defined? ::Appium::DATE
4
+ VERSION = '0.5.5' unless defined? ::Appium::VERSION
5
+ DATE = '2013-05-31' unless defined? ::Appium::DATE
6
6
  end
@@ -59,8 +59,22 @@ module Appium::Ios
59
59
  # @param text [String] the text to search for
60
60
  # @return [Element] the first matching element
61
61
  def find text
62
- js = first_ele_js "name contains[c] '#{text}' || label contains[c] '#{text}' || value contains[c] '#{text}'"
63
- execute_script js
62
+ ele = nil
63
+ # prefer value search. this may error with:
64
+ # Can't use in/contains operator with collection 1
65
+ js = first_ele_js "value contains[c] '#{text}'"
66
+ ignore { ele = execute_script js }
67
+
68
+ # now search name and label if the value search didn't match.
69
+ unless ele
70
+ js = first_ele_js "name contains[c] '#{text}' || label contains[c] '#{text}'"
71
+ ignore { ele ||= execute_script js }
72
+ end
73
+
74
+ # manually raise error if no element was found
75
+ raise Selenium::WebDriver::Error::NoSuchElementError, 'An element could not be located on the page using the given search parameters.' unless ele
76
+
77
+ ele
64
78
  end
65
79
 
66
80
  # Return all elements matching text.
@@ -1,3 +1,11 @@
1
+ #### v0.5.4 2013-05-28
2
+
3
+ - [9e95106](https://github.com/appium/ruby_lib/commit/9e951061b9da6cee7b90ee310bbbef2b7c660fb1) Release 0.5.4
4
+ - [d66020c](https://github.com/appium/ruby_lib/commit/d66020c66b02889d4a96809f41d02d4aa3e4b915) Fix gemspec. yard is required for docs task
5
+ - [1c6509d](https://github.com/appium/ruby_lib/commit/1c6509ddea68305b47f251e0d0c1ff4a5c1493ee) Add dev task to install gems required for release task
6
+ - [5106643](https://github.com/appium/ruby_lib/commit/51066439a4bacf7fea4a469044f6c3e2b60356c9) Add Sauce Storage support
7
+
8
+
1
9
  #### v0.5.3 2013-05-24
2
10
 
3
11
  - [b24565d](https://github.com/appium/ruby_lib/commit/b24565df67d4f0468ab5e3c1a700711a4c82b80d) Release 0.5.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-28 00:00:00.000000000 Z
12
+ date: 2013-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: -586570685424958921
153
+ hash: -3854797362292402686
154
154
  requirements: []
155
155
  rubyforge_project:
156
156
  rubygems_version: 1.8.25