appium_lib 0.3.1 → 0.3.2

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjQ3MTdiNzQwZmRjNTg0NDYxMTc1ODg5ODhiNjk2ZWEwZTgxNjhkMA==
4
+ MGU4NmE1ZTEzN2FmYmI3YWUwZjgyZTE2NmZkNTg0NWFkNWM4MjExYQ==
5
5
  data.tar.gz: !binary |-
6
- YTlkOGM3YzI5ZTFlNGQzZGIxNDkxN2Y2MWE2NjVlNmU3ODBiYWE4ZA==
6
+ MTQyMjY3NTEwZjRlMjFmZWM4M2Y5NjY5MWZkMTI1OWQ3MGMxNmJiMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWFiYmY4MzIzMTc1NDE5MWZhNTIwMzY3ZjMyZGU2YzBlZjhiYTMxNzI1MTA3
10
- Njg1MjE0ZDg0YjkwYTExNzg0OTIyYWZjMDUwMDg1OWRhZWY3YzE4YTkzNDU2
11
- Y2VlZWEzOTliNDEyNWMwMTA3YmNmZWRlMTQxNzE4ZDU0YTc5Yjg=
9
+ MWEyZjYwMjlkNDQyMjFkMDkyMzU0NDExZDNlZjA5NDk2YjVkZTQzMWM2YWU1
10
+ YTdjYTUzZGRkMzU3ZTg1NTgwNTE5MjY3ZWQwYzVmYzgxMGNiNjNlOWEzZTdh
11
+ OGM4NTJjNGRkNTMzN2ZiYTJhYWMxZjYzMWU0MzA0YWZjYmFmZjY=
12
12
  data.tar.gz: !binary |-
13
- ZDA0Y2UxMTg1ZDcxNzJhOWEwNmEzMjIxN2MyZDczY2UxMzgyODAxN2Q4M2Ey
14
- MjAyODM4OTUzYTk5ZGQxNGJmMmE1NjJkNTgxZTE3MGJiOGY0NzgzMDYyYzU3
15
- MTkzMWYwOWNmODQyZGQ5ZjBjNjE5YTA0OTQ5ZjUzZmVhMzNiN2M=
13
+ NTQ5NDUzMzhiMjExNjQ2MmRlYTViZjlhNTI5YTFkYjk2NjdlMTE3NDEwOWIw
14
+ OGYzMzllNWQ2YjE2NTE4YjYwN2Y4ZjA0YjgxNDI4ZWU2YjM4Njg5ZGUxMGZk
15
+ MDZhYWQzM2E1NmQzNzM2Y2NkMmM2N2ZiMjI5Y2JmMmJjODEyZjg=
@@ -80,4 +80,23 @@ module Selenium::WebDriver::Remote
80
80
  http.call verb, path, command_hash
81
81
  end # def
82
82
  end # class
83
- end if defined? Pry # module Selenium::WebDriver::Remote
83
+ end if defined? Pry # module Selenium::WebDriver::Remote
84
+
85
+ # Print Appium's origValue error messages.
86
+ class Selenium::WebDriver::Remote::Response
87
+ def error_message
88
+ val = value
89
+
90
+ case val
91
+ when Hash
92
+ msg = val['origValue'] || val['message'] or return 'unknown error'
93
+ msg << " (#{ val['class'] })" if val['class']
94
+ when String
95
+ msg = val
96
+ else
97
+ msg = "unknown error, status=#{status}: #{val.inspect}"
98
+ end
99
+
100
+ msg
101
+ end
102
+ end
@@ -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.3.1' unless defined? ::Appium::VERSION
4
+ VERSION = '0.3.2' unless defined? ::Appium::VERSION
5
5
  DATE = '2013-04-26' unless defined? ::Appium::DATE
6
6
  end
@@ -108,7 +108,7 @@ module Appium
108
108
  app: absolute_app_path,
109
109
  :'app-package' => @app_package,
110
110
  :'app-activity' => @app_activity,
111
- :'app-wait-activity' => @app_wait_activity
111
+ :'app-wait-activity' => @app_wait_activity || @app_activity
112
112
  }
113
113
  end
114
114
 
@@ -254,6 +254,13 @@ module Appium
254
254
  def mobile method, *args
255
255
  raise 'Method must not be nil' if method.nil?
256
256
  raise 'Method must have .to_s' unless method.respond_to? :to_s
257
+
258
+ if method.to_s.strip.downcase == 'reset'
259
+ # reset will undefine custom iOS JavaScript
260
+ # mark js as unloaded so it'll reload next use.
261
+ @ios_js = [] if @ios_js
262
+ end
263
+
257
264
  @driver.execute_script "mobile: #{method.to_s}", *args
258
265
  end
259
266
 
@@ -30,15 +30,17 @@ module Appium::Ios
30
30
  def name_contains_js
31
31
  # execute_script 'au.mainApp.getNameContains("sign")'
32
32
  # execute_script 'au.mainApp.getNameContains("zzz")'
33
+ # must check .isVisible or a hidden element may be returned.
34
+ # .tap() will error on invisible elements.
33
35
  <<-JS
34
36
  UIAElement.prototype.getNameContains = function(targetName) {
35
37
  var target = UIATarget.localTarget();
36
38
  target.pushTimeout(0);
37
- var search = "name contains[c] '" + targetName + "' || label contains[c] '" + targetName + "'";
39
+ var search = "(name contains[c] '" + targetName + "' || label contains[c] '" + targetName + "') && visible == 1";
38
40
  var searchElements = function(element) {
39
41
  var children = element.elements();
40
42
  var result = children.firstWithPredicate(search);
41
- if (result.type() !== 'UIAElementNil') {
43
+ if (result.type() !== 'UIAElementNil' && result.isVisible() === 1) {
42
44
  return result;
43
45
  }
44
46
 
data/readme.md CHANGED
@@ -33,6 +33,8 @@ require 'appium_lib'
33
33
  Appium::Driver.new.start_driver
34
34
 
35
35
  # Start an Android driver
36
+ # must quit old driver before starting a new one
37
+ driver_quit
36
38
  apk = { 'APP_PATH' => ENV['APP_APK'] }
37
39
  Appium::Driver.new(apk).start_driver
38
40
  ```
data/release_notes.md CHANGED
@@ -1,3 +1,14 @@
1
+ #### v0.3.1 2013-04-26
2
+
3
+ - [e00fc6e](https://github.com/appium/ruby_lib/commit/e00fc6efb8f0c94ac6e196e831980ee96676b645) Release 0.3.1
4
+ - [81d762a](https://github.com/appium/ruby_lib/commit/81d762a92293a9d59600154f1f0a5944aee5b439) Check method exists before calling
5
+ - [4b3f3dc](https://github.com/appium/ruby_lib/commit/4b3f3dc91714b08aae0acee51aa1137c58f59acb) Fix method dispatch
6
+ - [fa8b679](https://github.com/appium/ruby_lib/commit/fa8b679b816bd1507c7c9de3f301a3b8a7742d8f) Fix iOS name
7
+ - [5be26c4](https://github.com/appium/ruby_lib/commit/5be26c411fcf75154301749cd790487d3dd71ea9) Add sauce methods and find_name
8
+ - [b3724d3](https://github.com/appium/ruby_lib/commit/b3724d36a85188c7c8c85dadc313c6c43c8bed59) Add session_id
9
+ - [433de96](https://github.com/appium/ruby_lib/commit/433de96d25907841fbc9110d79ad0c1fa6eacf73) Update release notes
10
+
11
+
1
12
  #### v0.3.0 2013-04-25
2
13
 
3
14
  - [e08e88c](https://github.com/appium/ruby_lib/commit/e08e88c40cc56e132c5db18d9d5862028861d5f2) Release 0.3.0
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com