appium_lib_core 1.2.4 → 1.2.5

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
  SHA1:
3
- metadata.gz: 44fc100d5d5e9bd6eca0c7710db01c24e6f80c2e
4
- data.tar.gz: cdba41bed57c4d4f509e39460a273f697f1d19d8
3
+ metadata.gz: 926da09e2b71204628bf30a3816623e7f31419db
4
+ data.tar.gz: 176cf553eeca40bcb83b39972ee8b2e67de7d5c8
5
5
  SHA512:
6
- metadata.gz: 6ffd78624d5ffec1e6835dbf3f17c6664addc16e6d16ff4b1d58befaa96f0b1b6b0b6a5625cc7be98946858a69c2126e7b264668de458da94df48a03b71219fe
7
- data.tar.gz: 83e202a1d228ae437a1ae20daecbf94b1a460994e3f6a829374872558a61cdaa1fe0221517945ad331168607f0e71e25aa1ce31863efba945f0037a8dcfb1d24
6
+ metadata.gz: 50de46fcccbf804027e8cf84a46740be981b4f22679a033f277d16cf167194116df00473b9edea2684aad775cefc6807d57634856b26f760a35625742e3797d9
7
+ data.tar.gz: 295e932533dda3278df4b75fa99f1823f926187436480b15fbd8a88e9b911966c959227f6bfa85cd1fd2d58ccc80c117ed26d21480c23ed204cdbe22ea3e8bcc
data/CHANGELOG.md CHANGED
@@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  ### Deprecations
10
10
 
11
+ ## [1.2.5] - 2018-01-13
12
+ ### Enhancements
13
+ - Enhance W3C support
14
+ - Timeout related methods
15
+
16
+ ### Bug fixes
17
+
18
+ ### Deprecations
19
+
11
20
  ## [1.2.4] - 2018-01-03
12
21
  ### Enhancements
13
22
  - Refactor `create_session` in `Appium::Core::Base::Bridge`
@@ -5,6 +5,8 @@ module Appium
5
5
  # Prefix for extra capability defined by W3C
6
6
  APPIUM_PREFIX = 'appium:'.freeze
7
7
 
8
+ FORCE_MJSONWP = :forceMjsonwp
9
+
8
10
  # Almost same as self.handshake in ::Selenium::WebDriver::Remote::Bridge
9
11
  #
10
12
  # Implements protocol handshake which:
@@ -123,7 +125,7 @@ module Appium
123
125
  next if value.is_a?(String) && value.empty?
124
126
 
125
127
  capability_name = name.to_s
126
- w3c_name = appium_prefix?(capability_name, w3c_capabilities) ? name : "#{APPIUM_PREFIX}#{capability_name}"
128
+ w3c_name = extension_prefix?(capability_name, w3c_capabilities) ? name : "#{APPIUM_PREFIX}#{capability_name}"
127
129
 
128
130
  w3c_capabilities[w3c_name] = value
129
131
  end
@@ -133,13 +135,13 @@ module Appium
133
135
 
134
136
  private
135
137
 
136
- def appium_prefix?(capability_name, w3c_capabilities)
138
+ def extension_prefix?(capability_name, w3c_capabilities)
137
139
  snake_cased_capability_names = ::Selenium::WebDriver::Remote::W3C::Capabilities::KNOWN.map(&:to_s)
138
140
  camel_cased_capability_names = snake_cased_capability_names.map(&w3c_capabilities.method(:camel_case))
139
141
 
140
142
  snake_cased_capability_names.include?(capability_name) ||
141
143
  camel_cased_capability_names.include?(capability_name) ||
142
- capability_name.start_with?(APPIUM_PREFIX)
144
+ capability_name.match(::Selenium::WebDriver::Remote::W3C::Capabilities::EXTENSION_CAPABILITY_PATTERN)
143
145
  end
144
146
 
145
147
  def json_create(oss_status, value)
@@ -161,7 +163,7 @@ module Appium
161
163
  capabilities.each do |name, value|
162
164
  next if value.nil?
163
165
  next if value.is_a?(String) && value.empty?
164
- next if name == :forceMjsonwp
166
+ next if name == FORCE_MJSONWP
165
167
 
166
168
  w3c_capabilities[name] = value
167
169
  end
@@ -170,7 +172,7 @@ module Appium
170
172
  end
171
173
 
172
174
  def merged_capabilities(desired_capabilities)
173
- force_mjsonwp = desired_capabilities[:forceMjsonwp]
175
+ force_mjsonwp = desired_capabilities[FORCE_MJSONWP]
174
176
  desired_capabilities = delete_force_mjsonwp(desired_capabilities) unless force_mjsonwp.nil?
175
177
 
176
178
  if force_mjsonwp
@@ -34,6 +34,10 @@ module Appium
34
34
  end
35
35
  alias actions action
36
36
 
37
+ def get_timeouts
38
+ execute :get_timeouts
39
+ end
40
+
37
41
  # For Appium
38
42
  # override
39
43
  def page_source
@@ -68,6 +68,18 @@ module Appium
68
68
  def logs
69
69
  @logs ||= Logs.new(@bridge)
70
70
  end
71
+
72
+ # For W3C.
73
+ # Get the timeout related settings on the server side.
74
+ #
75
+ # @return [Hash]
76
+ #
77
+ # @example
78
+ # @driver.get_timeouts
79
+ #
80
+ def get_timeouts
81
+ @bridge.get_timeouts
82
+ end
71
83
  end # class Driver
72
84
  end # class Base
73
85
  end # module Core
@@ -89,6 +89,8 @@ module Appium
89
89
  # The fix will be included in selenium-3.8.2
90
90
  get_page_source: [:get, 'session/:session_id/source'.freeze],
91
91
 
92
+ get_timeouts: [:get, 'session/:session_id/timeouts'.freeze],
93
+
92
94
  ## Add OSS commands to W3C commands
93
95
  ### rotatable
94
96
  get_screen_orientation: [:get, 'session/:session_id/orientation'.freeze],
@@ -403,11 +403,6 @@ module Appium
403
403
  add_endpoint_method method
404
404
  end
405
405
 
406
- # Don't define selenium-side methods. We pick up from them.
407
- # ::Appium::Core::Base::Commands::MJSONWP.each_key do |method|
408
- # add_endpoint_method method
409
- # end
410
-
411
406
  add_endpoint_method(:available_contexts) do
412
407
  def available_contexts
413
408
  # return empty array instead of nil on failure
@@ -254,7 +254,7 @@ module Appium
254
254
  #
255
255
  # @example
256
256
  #
257
- # @core.platform_version #=> [10.1.1]
257
+ # @core.platform_version #=> [10,1,1]
258
258
  #
259
259
  def platform_version
260
260
  p_version = @driver.capabilities['platformVersion']
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '1.2.4'.freeze unless defined? ::Appium::Core::VERSION
4
- DATE = '2018-01-03'.freeze unless defined? ::Appium::Core::DATE
3
+ VERSION = '1.2.5'.freeze unless defined? ::Appium::Core::VERSION
4
+ DATE = '2018-01-13'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
data/release_notes.md CHANGED
@@ -1,3 +1,16 @@
1
+ #### v1.2.5 2018-01-13
2
+
3
+ - [0934b97](https://github.com/appium/ruby_lib_core/commit/0934b977419d6b5359dcc8e5b7c4edcd7f4916f4) Release 1.2.5
4
+ - [9497621](https://github.com/appium/ruby_lib_core/commit/9497621a62cdee727614d9c48ffff0f0f2faa7da) ignore extensional prefix (#49)
5
+ - [6337c78](https://github.com/appium/ruby_lib_core/commit/6337c7887873c12093ef854dde5a960bbe199449) update readme
6
+ - [9cbad5c](https://github.com/appium/ruby_lib_core/commit/9cbad5ca553d513c66508ede5f5f977aeb9f365d) add get timeouts for w3c (#46)
7
+ - [dacdc36](https://github.com/appium/ruby_lib_core/commit/dacdc3601cdc8a43b974db52ae164170945cc7ba) remove skip tests from unit tests (#45)
8
+ - [2d5c7ae](https://github.com/appium/ruby_lib_core/commit/2d5c7aed33a524d754cc28b5ae46cec917f48318) Fix typo in documentation of Driver#platform_version (#44)
9
+ - [d70f244](https://github.com/appium/ruby_lib_core/commit/d70f244ba260fed6c2d522a98d0c5516f3673c47) fix rubocop
10
+ - [c6f6528](https://github.com/appium/ruby_lib_core/commit/c6f652817b9d1ad104002d067bfb0452074653aa) add unit tests for forceMjsonwp
11
+ - [591a9bd](https://github.com/appium/ruby_lib_core/commit/591a9bd35b72287f10e47bdeae0de9dc2646b44a) add unit tests for w3c case (#43)
12
+
13
+
1
14
  #### v1.2.4 2018-01-03
2
15
 
3
16
  - [7032bc0](https://github.com/appium/ruby_lib_core/commit/7032bc02acc44640542eb545067a4125a7f1811f) Release 1.2.4
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: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver