appium_lib 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTA5MjVhYjAyZWEwMGM5NzQzYmI5OGRlZGU5NTkxMGM5YjY4ZDNmMw==
4
+ M2E4YzhhNzZlYWU2NDM5YTJjMjdhOGE1MTAwOTU3MDQyY2EyZmEwOA==
5
5
  data.tar.gz: !binary |-
6
- YTg3MDQxYjBmZTEzZDhkNjYyODg2ZDIzYTY3YWRkMzVmMTc4NDFiZg==
6
+ ZmIyNWMyMzgwNWJhOTAyYjc4ZTgxZDEyMDdkZTFhMzAzZjA4OWQ0OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OGYyMzJlNGE1NWY3YWI4OWU1ZGY4Y2U2OWUzODljMzc2YzRjZDJlM2JhZTc2
10
- OWU4Yzc3MmQzZGFiMjFiYjJmNjZmYTdkOWE3NzdlMjg5YjQwMDhlZGViNjMz
11
- NjEwNzJlZGFkOGM3YTMzYWJlYjJkZWY3ZGQ1ZmUzOWY2MjA5NmM=
9
+ N2FkNDg4NGJiODAzYjEyOWJiODgyMjdkMDA0YTE4MGRhNmVmMGQ4MDhkNDA3
10
+ YTEyNWRlM2ZiYTJmM2JjNTc4YTFmMTZmNjhlZmU5ZGVhNTYzZjIyMDZjZWQ4
11
+ ZDFmYjg2MjgwOGZmMThkNmUwMTFiZDFiOTk4OTZlNWUzM2U4MGQ=
12
12
  data.tar.gz: !binary |-
13
- NTNjYmE5OTU1YzVlM2EwNjcxNzFiOTY5ZmVkYzZkY2JmMTc3YzA0MzUzZDUz
14
- ODg2N2VmMjJkZTU4YjU2MGM4NzJhOTdjZGY2MDZkYjJhN2JhYjRhNmY5YzA5
15
- ZTgwMjVlNmI1NzM2OGY0NjExMTdjZTdjODVlODFhZmQwM2M0ZmQ=
13
+ NWZjZjA1ZDVmZTZhYmI4YjkyOTE1ODI3YmQ3OGEzNjQ2Yjc2YmVlZWY4OTBl
14
+ YmRkMTAwYzAwZjBhMzQ5NmRmNjg1ODFjMDBjYTY2YmU5ZjY0YjA1YzgzNmUw
15
+ ZjNmYWY5Mjk0ZWIxZTA4YzBkOGQ1NDFiZGMzYmRiY2FmOWRhYjc=
@@ -82,7 +82,7 @@ module Appium::Android
82
82
  r
83
83
  end
84
84
 
85
- json = JSON.parse(@driver.page_source)
85
+ json = get_source
86
86
  node = json['hierarchy']
87
87
  results = run node
88
88
 
@@ -150,7 +150,8 @@ module Appium::Common
150
150
  # Gets a JSON view of the current page
151
151
  # @return [JSON]
152
152
  def get_source
153
- JSON.parse(@driver.page_source)
153
+ # must set max nesting. default limit of 20 is too low for selendroid
154
+ JSON.parse @driver.page_source, max_nesting: 9999
154
155
  end
155
156
 
156
157
  def find_name name
@@ -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.4' unless defined? ::Appium::VERSION
4
+ VERSION = '0.3.5' unless defined? ::Appium::VERSION
5
5
  DATE = '2013-04-30' unless defined? ::Appium::DATE
6
6
  end
@@ -232,7 +232,7 @@ module Appium
232
232
  # Returns the default client side wait.
233
233
  # This value is independent of what the server is using
234
234
  # @return [Integer]
235
- def get_wait
235
+ def default_wait
236
236
  @default_wait
237
237
  end
238
238
 
@@ -314,4 +314,4 @@ end # end module Appium
314
314
  # Paging in Pry is annoying :q required to exit.
315
315
  # With pager disabled, the output is similar to IRB
316
316
  # Only set if Pry is defined.
317
- Pry.config.pager = false if defined?(Pry)
317
+ Pry.config.pager = false if defined?(Pry)
@@ -27,64 +27,6 @@ module Appium::Ios
27
27
  @ios_js.push method_name
28
28
  end
29
29
 
30
- def name_contains_js
31
- # execute_script 'au.mainApp.getNameContains("sign")'
32
- # execute_script 'au.mainApp.getNameContains("zzz")'
33
- # must check .isVisible or a hidden element may be returned.
34
- # .tap() may error on invisible elements.
35
- # if there are no visible elements though, then it's useful
36
- # to .tap() on an invisible element.
37
- <<-JS
38
- UIAElement.prototype.getNameContains = function(targetName) {
39
- var target = UIATarget.localTarget();
40
- target.pushTimeout(0);
41
- var search = "name contains[c] '" + targetName + "' || label contains[c] '" + targetName + "'";
42
- var result = {};
43
- result.type = function() { return 'UIAElementNil'; };
44
- result.isVisible = function() { return -1; };
45
-
46
- var searchElements = function(element) {
47
- var children = element.elements();
48
- var results = children.withPredicate(search);
49
-
50
- for (var resIdx = 0, resLen = results.length; resIdx < resLen; resIdx++) {
51
- var tmp = results[resIdx];
52
- if (tmp.type() !== 'UIAElementNil') {
53
- result = tmp;
54
- if (tmp.isVisible() === 1) {
55
- return tmp;
56
- }
57
- }
58
- }
59
-
60
- for ( var a = 0, len = children.length; a < len; a++) {
61
- searchElements(children[a]);
62
- if (result.type() !== 'UIAElementNil' && result.isVisible() === 1) {
63
- return result;
64
- }
65
- }
66
-
67
- return result;
68
- };
69
- var result = searchElements(this);
70
- target.popTimeout();
71
-
72
- if (result.type() === 'UIAElementNil') {
73
- return {
74
- status: 7,
75
- value: {'message': 'An element could not be located on the page using the given search parameters.'}
76
- };
77
- }
78
-
79
- console.log("Match is visible? " + result.isVisible())
80
- return {
81
- status: 0,
82
- value: {ELEMENT: au.getId(result)}
83
- };
84
- };
85
- JS
86
- end
87
-
88
30
  # returnElems requires a wrapped $(element).
89
31
  # set to empty array when length is zero to prevent hang.
90
32
  #
@@ -214,12 +156,7 @@ module Appium::Ios
214
156
  # @param name [String] the name to search for
215
157
  # @return [Element] the first matching element
216
158
  def name name
217
- unless ios_js_loaded? 'name_contains_js'
218
- execute_script name_contains_js
219
- ios_js_load 'name_contains_js'
220
- end
221
-
222
- execute_script %(au.mainApp.getNameContains("#{name}"))
159
+ mobile :findElementNameContains, name: name
223
160
  end
224
161
 
225
162
  # Return all elements matching name.
data/readme.md CHANGED
@@ -31,19 +31,18 @@ gem install --no-rdoc --no-ri appium_lib
31
31
  #### Simple Usage
32
32
 
33
33
  ```ruby
34
+ require 'rubygems'
34
35
  require 'appium_lib'
35
36
 
36
- # Start an iOS driver based on APP_PATH
37
- app = { 'APP_PATH' => '/path/to/MyiOS.app' }
37
+ # Start iOS driver
38
+ app = { app_path: '/path/to/MyiOS.app'}
38
39
  Appium::Driver.new(app).start_driver
39
40
 
40
- # Start an Android driver
41
- # must quit old driver before starting a new one
42
- driver_quit
43
- apk = { 'APP_PATH' => '/path/to/the.apk',
44
- 'APP_PACKAGE' => 'com.example.pkg',
45
- 'APP_ACTIVITY' => 'act.Start',
46
- 'APP_WAIT_ACTIVITY' => 'act.Splash' }
41
+ # Start Android driver
42
+ apk = { app_path: '/path/to/the.apk',
43
+ app_package: 'com.example.pkg',
44
+ app_activity: 'act.Start'
45
+ }
47
46
  Appium::Driver.new(apk).start_driver
48
47
  ```
49
48
 
@@ -1,3 +1,16 @@
1
+ #### v0.3.4 2013-04-30
2
+
3
+ - [ffdf104](https://github.com/appium/ruby_lib/commit/ffdf104ffdecb165cfe410976145134768756e30) Release 0.3.4
4
+ - [4edc9f6](https://github.com/appium/ruby_lib/commit/4edc9f6097e29d2816dceef546a819fd6ee431d2) Add params to wait
5
+ - [da1c042](https://github.com/appium/ruby_lib/commit/da1c0424873fa5f859b1ec558356a3ad0721097b) Add selendroid launch support
6
+ - [f398041](https://github.com/appium/ruby_lib/commit/f398041369884d8068950ab9e703a8a2d750082c) Use symbols for driver opts
7
+ - [cf09a0d](https://github.com/appium/ruby_lib/commit/cf09a0d1ca8de835043f855cbd74ced9abb5f1b0) Add expected server opts
8
+ - [fe6c7d7](https://github.com/appium/ruby_lib/commit/fe6c7d71dbaf7f7b383d117918de2498945406d4) Fix os specific patches
9
+ - [d9b9c1a](https://github.com/appium/ruby_lib/commit/d9b9c1a2fcc1857e0e7c78d250fd59b84726d69b) Improve logging
10
+ - [3b831b0](https://github.com/appium/ruby_lib/commit/3b831b089e02c4a53585d90ed009f5ad3cb982a7) Return invisible match if no visible result
11
+ - [cdb11b6](https://github.com/appium/ruby_lib/commit/cdb11b6facde318af2524499c6473ea736865dde) Update release notes
12
+
13
+
1
14
  #### v0.3.3 2013-04-27
2
15
 
3
16
  - [b0ca37c](https://github.com/appium/ruby_lib/commit/b0ca37cfe47318f029e1f2ad498a5c08338016d7) Release 0.3.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.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com