appium_lib_core 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92b2cc51e93cc1cafd0eab292b939f2c8a4857d37c4b058d1cd3d88efc3905c5
4
- data.tar.gz: 35b8bd65ee71b69e266a12f79f0f8a47817e3ac3049657808a5c19b0b78651dc
3
+ metadata.gz: a9b66f981cafd023dfc8cdb398caa26eeb541efc8597925141efab36ae34bbd2
4
+ data.tar.gz: f5af2acc2ad6f048ec4a6260a625cab7fbaf30b84c1cb764be603d34d05c8fd0
5
5
  SHA512:
6
- metadata.gz: e5cdd8c9da12e8a996b1b314ab56a04e31b8411323bb4de172e721f7e48f4bd9807cb1b25466361448c2189d1f0eec1b37ea81303e29e580cdc59b2d5f2ed2d0
7
- data.tar.gz: 419ce910892d446ebeb341c34853bee00e48a363f631d97362c6435a31d187a9223defcc25ac273cdd212ee4d082710afdc0e321a1a0c9f45ccf620dc15a9b32
6
+ metadata.gz: 3695004d74d0250a98976a650fddf63b1d37f6c20e4c33f804ae919679c032fa00aa69d8bdaf113e84a9552562797a0932ffd8988d8b8cc5b0b62ce9d1c2e225
7
+ data.tar.gz: d21248a3d9e81495b03655197b0917f8833d4192293ed1580c663e4a234f3121a54ca5ed8ad872be70e5043605afb6ccc0d68cb75b40a0d2efda4723ebbac812
@@ -10,6 +10,17 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [3.0.2] - 2019-03-07
14
+
15
+ ### Enhancements
16
+ - Append more examples for use case in `test/functional` as functional test cases
17
+
18
+ ### Bug fixes
19
+ - [internal] Fixed typo in `Emulator#gsm_signal` [#196](https://github.com/appium/ruby_lib_core/pull/196)
20
+ - Thanks [khanhdodang](https://github.com/khanhdodang)
21
+
22
+ ### Deprecations
23
+
13
24
  ## [3.0.1] - 2019-02-25
14
25
 
15
26
  ### Enhancements
data/README.md CHANGED
@@ -97,7 +97,9 @@ $ PARALLEL=1 bundle exec parallel_test test/functional/ios -n 2
97
97
  # shell 2
98
98
  $ ruby test.rb
99
99
  ```
100
-
100
+
101
+ More examples are in [test/functional](test/functional)
102
+
101
103
  ### Capabilities
102
104
 
103
105
  Read [Appium/Core/Driver](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Driver) to catch up with available capabilities.
@@ -119,7 +119,8 @@ module Appium
119
119
  def gsm_signal(signal_strength)
120
120
  raise "#{signal_strength} should be member of #{GSM_SIGNALS} " if GSM_SIGNALS[signal_strength.to_sym].nil?
121
121
 
122
- execute(:gsm_signal, {}, { signalStrengh: GSM_SIGNALS[signal_strength] })
122
+ execute(:gsm_signal, {}, { signalStrength: GSM_SIGNALS[signal_strength],
123
+ signalStrengh: GSM_SIGNALS[signal_strength] })
123
124
  end
124
125
  end
125
126
 
@@ -129,7 +129,9 @@ module Appium
129
129
  # @driver.send_keys 'happy testing!'
130
130
  #
131
131
  def send_keys(*key)
132
- warn '[DEPRECATION] Driver#send_keys is deprecated in W3C spec. Use driver.action.<command>.perform instead'
132
+ ::Appium::Logger.warn(
133
+ '[DEPRECATION] Driver#send_keys is deprecated in W3C spec. Use driver.action.<command>.perform instead'
134
+ )
133
135
  @bridge.send_keys_to_active_element(key)
134
136
  end
135
137
  alias type send_keys
@@ -24,7 +24,7 @@ module Appium
24
24
  def update_sending_request_to(scheme:, host:, port:, path:)
25
25
  return @server_url unless validate_url_param(scheme, host, port, path)
26
26
 
27
- Logger.debug("[experimental] This feature, #{__method__}, is an experimental")
27
+ ::Appium::Logger.debug("[experimental] This feature, #{__method__}, is an experimental")
28
28
 
29
29
  # Add / if `path` does not have it
30
30
  path = path.start_with?('/') ? path : "/#{path}"
@@ -37,7 +37,11 @@ module Appium
37
37
  private
38
38
 
39
39
  def validate_url_param(scheme, host, port, path)
40
- !(scheme.nil? || host.nil? || port.nil? || path.nil?)
40
+ return true unless [scheme, host, port, path].include?(nil)
41
+
42
+ message = "Given parameters are scheme: '#{scheme}', host: '#{host}', port: '#{port}', path: '#{path}'"
43
+ ::Appium::Logger.warn(message)
44
+ false
41
45
  end
42
46
 
43
47
  public
@@ -53,8 +57,8 @@ module Appium
53
57
  payload = JSON.generate(command_hash)
54
58
  headers['Content-Length'] = payload.bytesize.to_s if [:post, :put].include?(verb)
55
59
 
56
- Logger.info(" >>> #{url} | #{payload}")
57
- Logger.debug(" > #{headers.inspect}")
60
+ ::Appium::Logger.info(" >>> #{url} | #{payload}")
61
+ ::Appium::Logger.debug(" > #{headers.inspect}")
58
62
  elsif verb == :post
59
63
  payload = '{}'
60
64
  headers['Content-Length'] = '2'
@@ -48,6 +48,35 @@ module Appium
48
48
  end
49
49
  end
50
50
 
51
+ # DirectConnections has capabilities of directConnect
52
+ class DirectConnections
53
+ KEYS = {
54
+ protocol: 'directConnectProtocol',
55
+ host: 'directConnectHost',
56
+ port: 'directConnectPort',
57
+ path: 'directConnectPath'
58
+ }.freeze
59
+
60
+ # @return [string] Returns a protocol such as http/https
61
+ attr_reader :protocol
62
+
63
+ # @return [string] Returns a host name such as io.appium
64
+ attr_reader :host
65
+
66
+ # @return [integer] Returns a port number such as 443
67
+ attr_reader :port
68
+
69
+ # @return [string] Returns a path for webdriver such as <code>/hub/wd</code>
70
+ attr_reader :path
71
+
72
+ def initialize(capabilities)
73
+ @protocol = capabilities[KEYS[:protocol]]
74
+ @host = capabilities[KEYS[:host]]
75
+ @port = capabilities[KEYS[:port]]
76
+ @path = capabilities[KEYS[:path]]
77
+ end
78
+ end
79
+
51
80
  class Driver
52
81
  include Waitable
53
82
  # Selenium webdriver capabilities
@@ -302,10 +331,8 @@ module Appium
302
331
  listener: @listener)
303
332
 
304
333
  if @direct_connect
305
- @driver.update_sending_request_to(protocol: @driver.capabilities['directConnectProtocol'],
306
- host: @driver.capabilities['directConnectHost'],
307
- port: @driver.capabilities['directConnectPort'],
308
- path: @driver.capabilities['directConnectPath'])
334
+ d_c = DirectConnections.new(@driver.capabilities)
335
+ @driver.update_sending_request_to(protocol: d_c.protocol, host: d_c.host, port: d_c.port, path: d_c.path)
309
336
  end
310
337
 
311
338
  # export session
@@ -341,7 +368,7 @@ module Appium
341
368
  raise ::Appium::Core::Error::ServerError, e.message
342
369
  end
343
370
 
344
- Appium::Logger.debug(e.message)
371
+ ::Appium::Logger.debug(e.message)
345
372
  {}
346
373
  end
347
374
 
@@ -412,7 +439,7 @@ module Appium
412
439
  # # same as `@driver.save_screenshot png_save_path`
413
440
  #
414
441
  def screenshot(png_save_path)
415
- warn '[DEPRECATION] screenshot will be removed. Please use driver.save_screenshot instead.'
442
+ ::Appium::Logger.warn '[DEPRECATION] screenshot will be removed. Please use driver.save_screenshot instead.'
416
443
  @driver.save_screenshot png_save_path
417
444
  end
418
445
 
@@ -442,18 +469,18 @@ module Appium
442
469
  end
443
470
  when :mac
444
471
  # no Mac specific extentions
445
- Appium::Logger.debug('mac')
472
+ ::Appium::Logger.debug('mac')
446
473
  when :windows
447
474
  # no windows specific extentions
448
- Appium::Logger.debug('windows')
475
+ ::Appium::Logger.debug('windows')
449
476
  when :tizen
450
477
  # https://github.com/Samsung/appium-tizen-driver
451
- Appium::Logger.debug('tizen')
478
+ ::Appium::Logger.debug('tizen')
452
479
  when :youiengine
453
480
  # https://github.com/YOU-i-Labs/appium-youiengine-driver
454
- Appium::Logger.debug('YouiEngine')
481
+ ::Appium::Logger.debug('YouiEngine')
455
482
  else
456
- Appium::Logger.warn('no device matched')
483
+ ::Appium::Logger.warn('no device matched')
457
484
  end
458
485
 
459
486
  self
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '3.0.1'.freeze unless defined? ::Appium::Core::VERSION
4
- DATE = '2019-02-25'.freeze unless defined? ::Appium::Core::DATE
3
+ VERSION = '3.0.2'.freeze unless defined? ::Appium::Core::VERSION
4
+ DATE = '2019-03-07'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
@@ -1,3 +1,15 @@
1
+ #### v3.0.2 2019-03-07
2
+
3
+ - [e2f6010](https://github.com/appium/ruby_lib_core/commit/e2f601086f9daf377270a780d5300687be37ada0) Release 3.0.2
4
+ - [90c57cd](https://github.com/appium/ruby_lib_core/commit/90c57cd20013a8d94a479cf8066ff68c2aeef4fe) Add w3c common actions scroll (#197)
5
+ - [f95a17d](https://github.com/appium/ruby_lib_core/commit/f95a17d28eb50798eefdd8685cdfb4113472318f) Fixed typo signalStrengh (#196)
6
+ - [253c92e](https://github.com/appium/ruby_lib_core/commit/253c92ee3cf04eac4cbcd9014cc916f5b8cb29d6) add tests for find by image with scaled ratio
7
+ - [dfc4ca3](https://github.com/appium/ruby_lib_core/commit/dfc4ca37c23cd9cd53690ce0ca9c8981f2747355) fix the name of settings
8
+ - [3a811b5](https://github.com/appium/ruby_lib_core/commit/3a811b5004452e82d3915f6c8c6fb87b83cf00b1) define DirectConnections to handle direct connections
9
+ - [ae32597](https://github.com/appium/ruby_lib_core/commit/ae32597662b02511c0dfed065890fd4d61e51a28) tweak wait
10
+ - [eda0b26](https://github.com/appium/ruby_lib_core/commit/eda0b26085dcb86bf24deb2f778d2ec4b5a7fdc1) tweak appium logger (#195)
11
+
12
+
1
13
  #### v3.0.1 2019-02-25
2
14
 
3
15
  - [8a63795](https://github.com/appium/ruby_lib_core/commit/8a63795df8ac9caa9a5e2208b69211a7db841108) Release 3.0.1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-25 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver