wda_lib 0.3.0 → 0.3.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7517995dcdb3b10660a1f72b2f928aca7ba1ef0f
4
- data.tar.gz: 18612a392b4c51a524f4df05163e2fce9f9cd65e
3
+ metadata.gz: 29881aa99b6971c0aaa5c6194bb7359a20cbfd85
4
+ data.tar.gz: e6a2e1b66ba4db53014c8804649f3db5ba3c8c59
5
5
  SHA512:
6
- metadata.gz: 27167966a5303de42ad65f67b4267a39ecb02298eb98353142a70f025befaa51794019e73228549a54f4fcab754252edc430b2df9b4ca7e3d1181700ba7c63f2
7
- data.tar.gz: 40125773e8a05e39eae7e61a42cad5eb5f7842565f1b8e6a5a9d8fb944f8e4ab2e6d86fb0d5521443a06c8af8434c5b4c3159c381bf79da30c3aaa7fd3f7c0ef
6
+ metadata.gz: 815790dbcd4e6dfb32b227c10f343112b279bb76dd0d3da4cd8b38ad6cacbf0b2b229d7bb011e4293560f56d17e5a7c7c3b6dcd028f4f9ba71e0f40ca08415da
7
+ data.tar.gz: 826dbaa690c9a686d4e3af93b1f407cb09237384ae19dc5e4ce9ab34ca8d3a1a80c11450a18d94f037271f81173fa90e3bbdb93f0c07e2754ac81d4a72eb7a4c
@@ -16,6 +16,8 @@ app.button('Alerts').ref
16
16
 
17
17
  app.button('Alerts').name
18
18
 
19
+ app.exists { app.button('Alerts') }
20
+
19
21
  app.button('Alerts').click
20
22
 
21
23
  app.partial_texts('Create')[1].click
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  # Patch or add methods for Bridge. Called by Element instance or Bridge instance
6
6
  require 'pry'
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
 
6
6
  module Selenium
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
 
6
6
  # require 'selenium-webdriver'
data/lib/wda_lib.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  Dir[File.dirname(__FILE__) + '/wda_lib/*.rb'].each {|file| require file }
6
6
  require 'json'
data/lib/wda_lib/alert.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Alert
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Custome
data/lib/wda_lib/debug.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Debug
@@ -11,8 +11,7 @@ class WDA
11
11
  # When accessible is false, and visible is true, ignore all invisible elements
12
12
  # @return [Hash]
13
13
  def source(opts = {})
14
- response_type = opts.fetch(:response_type, 'xml')
15
- response_type = 'json' if opts.empty?
14
+ response_type = opts.fetch(:response_type, 'json')
16
15
  session_id = opts.fetch(:session_id, nil)
17
16
  # not_fetch_inaccessible = opts.fetch(:not_fetch_inaccessible, true)
18
17
  # not_fetch_invisible = opts.fetch(:not_fetch_invisible, true)
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  class Element
@@ -38,8 +38,8 @@ class WDA
38
38
  # Get attribute value
39
39
  # @param name [String]
40
40
  # @return is attributeValue [String]
41
- def attribute(name)
42
- client.get '/element/' + eid + '/attribute/' + name
41
+ def attribute
42
+ client.get '/element/' + eid + '/attribute/name'
43
43
  end
44
44
 
45
45
  # Get text from an element(StaticText or Button)
@@ -72,6 +72,10 @@ class WDA
72
72
  client.get('/element/' + eid + '/name')['value']
73
73
  end
74
74
 
75
+ def name
76
+ type
77
+ end
78
+
75
79
  # Set value to an element
76
80
  # @param value [String]
77
81
  # @return element uuid [String]
@@ -153,7 +157,7 @@ class WDA
153
157
  # Get element size
154
158
  # @return [Struct] [:x, :y]
155
159
  def location
156
- r = rect['value']
160
+ r = rect
157
161
  Point.new(r['x'], r['y'])
158
162
  end
159
163
 
@@ -168,13 +172,13 @@ class WDA
168
172
  # Swipe on an element with its id and position
169
173
  # @param fromX [Integer], toX [Integer], fromY [Integer], toY [Integer]
170
174
  def swipe(fromX, toX, fromY, toY)
171
- post '/uiaTarget/0/dragfromtoforduration', { fromX: fromX, toX: toX, fromY: fromY, toY: toY, duration: 0 }
175
+ post '/wda/dragfromtoforduration', { fromX: fromX, toX: toX, fromY: fromY, toY: toY, duration: 0 }
172
176
  end
173
177
 
174
178
  # Tap on a given positon
175
179
  # @param x [Integer], y [Integer]
176
180
  def tap_on(x, y)
177
- post '/wda/tap/0', { x: x, y: y }
181
+ post '/wda/tap/nil', { x: x, y: y}
178
182
  end
179
183
 
180
184
  # Double tap on a given positon
data/lib/wda_lib/error.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Error
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module FindElement
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Orientation
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  require 'base64'
6
6
 
@@ -1,14 +1,14 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Session
7
7
 
8
8
  # Get current status
9
9
  # @return [Obj]
10
- def status
11
- @status = get(@base_url + '/status', 5)
10
+ def status(status_timeout = 5)
11
+ @status = get(@base_url + '/status', status_timeout)
12
12
  @platform_name = @status['value']['os']['name']
13
13
  @platform_version = @status['value']['os']['version']
14
14
  update_status(@status)
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module TouchID
data/lib/wda_lib/type.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
6
  module Type
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Created by Yi MIN<yi@zen.ly>
3
- # Copyright © 2016 Zenly. All rights reserved.
3
+ # Copyright © 2017 Zenly. All rights reserved.
4
4
  #
5
5
  class WDA
6
- VERSION = '0.3.0'
6
+ VERSION = '0.3.1'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wda_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - MIN Yi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake