appium_lib_core 5.8.0 → 6.0.0

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: 06c7b0bb078ece1a833874436e4611cb407cc762d73dd2fbcb27e69ace076e14
4
- data.tar.gz: ab4e2733c06ed9866368e983c4e2a28510a4125eff5614e404c3e83f1eaceae9
3
+ metadata.gz: e147792f868660dca695a4e5bf9c31753f68515f5cd5b5bb66e4150028d7e1b4
4
+ data.tar.gz: 27b0afff682d0630df7a2e8d1e2ab5bc187b63049dce918b7f4cdc2a7868fd1a
5
5
  SHA512:
6
- metadata.gz: fd894aaad52613559c842c0a42ff6d6bbfc9b871ea5f3bf02a302f7ae53e9b7cb6397bea363f9108ac9bbe601f1f1cacb5fa38ee4371eebaf875d2e64b756cf4
7
- data.tar.gz: '097f706be4f0403e6397bdb941f1f63ced8c6cfae8a7f68af401ffcd0fa2e75d81051b37d1f421c9d60051c85f125c6662edb8461f8fcbc7afcaa6a89ba69142'
6
+ metadata.gz: a3711c2f4ad056cc0278d1c7dfc174a6c5ebe87b7f772933f8a8d96dbfd3c9648c9aafc314e0f4e5854f01cd65ae066c7024e6519f4d4678d1c7fc5e48d80eb4
7
+ data.tar.gz: fb870f142226ee8ceadffd6962d028bd9b557fc8380972c12f138123181a95dc8e8887006365154e00372dbebd0f60a196b6965d6fff81060979519718412b1d
data/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [6.0.0] - 2022-12-25
14
+ - Remove iOS/UiAutomation classes
15
+ - The version may work for iOS 8. XCUITest driver will be the default behavior for iOS.
16
+
13
17
  ## [5.8.0] - 2022-12-11
14
18
 
15
19
  ### Enhancements
data/README.md CHANGED
@@ -32,6 +32,13 @@ $ bundle install
32
32
  $ bundle exec parallel_test test/unit/
33
33
  ```
34
34
 
35
+ or
36
+
37
+ ```bash
38
+ $ bundle install
39
+ $ bundle exec rake test:unit
40
+ ```
41
+
35
42
  ### Functional Tests
36
43
  Run functional tests which require the Appium server and real device, Simulator/Emulator.
37
44
 
@@ -107,8 +114,8 @@ $ IGNORE_VERSION_SKIP=true CI=true bundle exec rake test:func:android
107
114
  platformName: 'ios',
108
115
  platformVersion: '11.0',
109
116
  deviceName: 'iPhone Simulator',
110
- automationName: 'XCUITest',
111
- app: '/path/to/MyiOS.app'
117
+ # app: '/path/to/MyiOS.app', # Without 'app' capability, an appium session starts with the home screen
118
+ automationName: 'XCUITest'
112
119
  },
113
120
  appium_lib: {
114
121
  wait: 30
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'appium_lib_core/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.required_ruby_version = '>= 2.7'
7
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7')
8
8
 
9
9
  spec.name = 'appium_lib_core'
10
10
  spec.version = Appium::Core::VERSION
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'minitest', '~> 5.0'
31
31
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
32
32
  spec.add_development_dependency 'webmock', '~> 3.18.1'
33
- spec.add_development_dependency 'rubocop', '1.39.0'
33
+ spec.add_development_dependency 'rubocop', '1.41.1'
34
34
  spec.add_development_dependency 'appium_thor', '~> 1.0'
35
35
  spec.add_development_dependency 'parallel_tests'
36
36
  spec.add_development_dependency 'simplecov'
@@ -211,11 +211,6 @@ module Appium
211
211
  ::Appium::Core::Base::Capabilities.json_create execute(:get_capabilities)
212
212
  end
213
213
 
214
- # Override for safe. Newer ruby selenium webdriver already has the same code
215
- def page_source
216
- execute :get_page_source
217
- end
218
-
219
214
  # For Appium
220
215
  # override
221
216
  def element_displayed?(element)
@@ -229,7 +224,8 @@ module Appium
229
224
  # override
230
225
  def element_attribute(element, name)
231
226
  # For W3C in Selenium Client
232
- # execute_atom :getAttribute, element, name
227
+ # execute_atom :getAttribute, element, name.
228
+ # 'dom_attribute' in the WebDriver Selenium.
233
229
  execute :get_element_attribute, id: element.id, name: name
234
230
  end
235
231
 
@@ -28,7 +28,6 @@ module Appium
28
28
  data_matcher: '-android datamatcher', # Available in Espresso
29
29
  view_matcher: '-android viewmatcher', # Available in Espresso
30
30
  # iOS
31
- uiautomation: '-ios uiautomation',
32
31
  predicate: '-ios predicate string',
33
32
  class_chain: '-ios class chain',
34
33
  # Windows with windows prefix
@@ -70,11 +70,15 @@ module Appium
70
70
  find_elements: [:post, 'session/:session_id/elements'],
71
71
  find_child_element: [:post, 'session/:session_id/element/:id/element'],
72
72
  find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
73
+ find_shadow_child_element: [:post, 'session/:session_id/shadow/:id/element'],
74
+ find_shadow_child_elements: [:post, 'session/:session_id/shadow/:id/elements'],
73
75
  get_active_element: [:get, 'session/:session_id/element/active'],
74
76
  is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
75
77
  get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
76
78
  get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],
77
79
  get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],
80
+ get_element_aria_role: [:get, 'session/:session_id/element/:id/computedrole'],
81
+ get_element_aria_label: [:get, 'session/:session_id/element/:id/computedlabel'],
78
82
  get_element_text: [:get, 'session/:session_id/element/:id/text'],
79
83
  get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],
80
84
  get_element_rect: [:get, 'session/:session_id/element/:id/rect'],
@@ -23,7 +23,6 @@ module Appium
23
23
  end
24
24
 
25
25
  module Ios
26
- autoload :Uiautomation, 'appium_lib_core/ios'
27
26
  autoload :Xcuitest, 'appium_lib_core/ios_xcuitest'
28
27
  end
29
28
 
@@ -328,7 +327,7 @@ module Appium
328
327
  public
329
328
 
330
329
  # @private
331
- # Set up for a neww session
330
+ # Set up for a new session
332
331
  def setup_for_new_session(opts = {})
333
332
  @custom_url = opts.delete :url # to set the custom url as :url
334
333
 
@@ -443,7 +442,7 @@ module Appium
443
442
  @driver
444
443
  end
445
444
 
446
- # @privvate
445
+ # @private
447
446
  # Attach to an existing session
448
447
  def attach_to(session_id, url: nil, automation_name: nil, platform_name: nil,
449
448
  http_client_ops: { http_client: nil, open_timeout: 999_999, read_timeout: 999_999 })
@@ -509,7 +508,7 @@ module Appium
509
508
  {}
510
509
  end
511
510
 
512
- # Quits the driver
511
+ # [Deprecated] Quits the driver. This method is the same as @driver.quit
513
512
  # @return [void]
514
513
  #
515
514
  # @example
@@ -517,6 +516,7 @@ module Appium
517
516
  # @core.quit_driver
518
517
  #
519
518
  def quit_driver
519
+ ::Appium::Logger.warn('[DEPRECATION] quit_driver will be removed. Please use @driver.quit instead.')
520
520
  @driver.quit
521
521
  rescue # rubocop:disable Style/RescueStandardError
522
522
  nil
@@ -562,6 +562,11 @@ module Appium
562
562
  # @core.platform_version #=> [10,1,1]
563
563
  #
564
564
  def platform_version
565
+ ::Appium::Logger.warn(
566
+ '[DEPRECATION] platform_version method will be. ' \
567
+ 'Please check the platformVersion via @driver.capabilities["platformVersion"] instead.'
568
+ )
569
+
565
570
  p_version = @driver.capabilities['platformVersion'] || @driver.session_capabilities['platformVersion']
566
571
  p_version.split('.').map(&:to_i)
567
572
  end
@@ -599,10 +604,8 @@ module Appium
599
604
  case sym_automation_name
600
605
  when :safari
601
606
  ::Appium::Logger.debug('SafariDriver for iOS')
602
- when :xcuitest
607
+ else # XCUITest
603
608
  ::Appium::Core::Ios::Xcuitest::Bridge.for self
604
- else # default and UIAutomation
605
- ::Appium::Core::Ios::Uiautomation::Bridge.for self
606
609
  end
607
610
  when :mac
608
611
  case sym_automation_name
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '5.8.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2022-12-11' unless defined? ::Appium::Core::DATE
17
+ VERSION = '6.0.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2022-12-25' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
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: 5.8.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-11 00:00:00.000000000 Z
11
+ date: 2022-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 1.39.0
123
+ version: 1.41.1
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - '='
129
129
  - !ruby/object:Gem::Version
130
- version: 1.39.0
130
+ version: 1.41.1
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: appium_thor
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -247,12 +247,8 @@ files:
247
247
  - lib/appium_lib_core/device.rb
248
248
  - lib/appium_lib_core/driver.rb
249
249
  - lib/appium_lib_core/element.rb
250
- - lib/appium_lib_core/ios.rb
251
250
  - lib/appium_lib_core/ios/device.rb
252
251
  - lib/appium_lib_core/ios/device/clipboard.rb
253
- - lib/appium_lib_core/ios/uiautomation/bridge.rb
254
- - lib/appium_lib_core/ios/uiautomation/device.rb
255
- - lib/appium_lib_core/ios/uiautomation/patch.rb
256
252
  - lib/appium_lib_core/ios/xcuitest/bridge.rb
257
253
  - lib/appium_lib_core/ios/xcuitest/device.rb
258
254
  - lib/appium_lib_core/ios/xcuitest/device/battery.rb
@@ -273,7 +269,7 @@ homepage: https://github.com/appium/ruby_lib_core/
273
269
  licenses:
274
270
  - Apache-2.0
275
271
  metadata: {}
276
- post_install_message:
272
+ post_install_message:
277
273
  rdoc_options: []
278
274
  require_paths:
279
275
  - lib
@@ -288,8 +284,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
284
  - !ruby/object:Gem::Version
289
285
  version: '0'
290
286
  requirements: []
291
- rubygems_version: 3.3.3
292
- signing_key:
287
+ rubygems_version: 3.2.14
288
+ signing_key:
293
289
  specification_version: 4
294
290
  summary: Minimal Ruby library for Appium.
295
291
  test_files: []
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Appium
16
- module Core
17
- module Ios
18
- module Uiautomation
19
- module Bridge
20
- def self.for(target)
21
- target.extend Appium::Core::Ios::Device
22
-
23
- Core::Ios::Uiautomation.patch_webdriver_element
24
- Core::Ios::Uiautomation::Device.add_methods
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Appium
16
- module Core
17
- module Ios
18
- module Uiautomation
19
- module Device
20
- def self.add_methods
21
- # UiAutomation, Override included method in bridge
22
- ::Appium::Core::Device.add_endpoint_method(:hide_keyboard) do
23
- def hide_keyboard(close_key = nil, strategy = nil)
24
- option = {}
25
-
26
- option[:key] = close_key || 'Done' # default to Done key.
27
- option[:strategy] = strategy || :pressKey # default to pressKey
28
-
29
- execute :hide_keyboard, {}, option
30
- end
31
- end
32
-
33
- # UiAutomation, Override included method in bridge
34
- ::Appium::Core::Device.add_endpoint_method(:background_app) do
35
- def background_app(duration = 0)
36
- execute :background_app, {}, seconds: duration
37
- end
38
- end
39
- end
40
- end # module Device
41
- end # module Uiautomation
42
- end # module Ios
43
- end # module Core
44
- end # module Appium
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Appium
16
- module Core
17
- module Ios
18
- module Uiautomation
19
- # @private
20
- # class_eval inside a method because class Selenium::WebDriver::Element
21
- # will trigger as soon as the file is required. in contrast a method
22
- # will trigger only when invoked.
23
- def self.patch_webdriver_element
24
- ::Appium::Core::Element.class_eval do
25
- # Cross platform way of entering text into a textfield
26
- def type(text, driver)
27
- driver.execute_script %(au.getElement('#{ref}').setValue('#{text}');)
28
- end # def type
29
- end # Selenium::WebDriver::Element.class_eval
30
- end # def patch_webdriver_element
31
- end # module Uiautomation
32
- end # module Ios
33
- end # module Core
34
- end # module Appium
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- # loaded in common/driver.rb
16
- require_relative 'ios/device'
17
-
18
- require_relative 'ios/uiautomation/patch'
19
- require_relative 'ios/uiautomation/device'
20
- require_relative 'ios/uiautomation/bridge'