appium_lib_core 5.0.0 → 5.1.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: 88e1099c62a49f922529ee84563d0b475c160a981451da59210819e61956f985
4
- data.tar.gz: bb653d62d35c461e8e0c9dcec726064992e735418b20c85b4aa6aae16d9b0a88
3
+ metadata.gz: 15447eabf9741951c87185aa6844f1b7acfab0bbcef6e70061ccebbd423dc00b
4
+ data.tar.gz: a135b4d1b7b4cfd49cce6a684a98fcb508a5a7f8bf770c35b2c323ac74a4f5e2
5
5
  SHA512:
6
- metadata.gz: 1a18f9f6ea13b72f0aff09ea748c102fdfe202be60ac59f7fcaceee34485746a75fd83d8e438c2fd0447b64ce3c17655418ccdf599fba618afd75db7bab72e73
7
- data.tar.gz: 6cac7cbba8c64d8f97fa34af6adc1b33f432549950551826cfc0e1d0340e0add900b85bf0c09cbbfa9fae551aec873d68b08b9f301d9ace40e9716d453c3ca4b
6
+ metadata.gz: 424e4f1bf4e4fa14bf5582cf74ff32cc248ab430878900bb154ed4a12ad089a84c6c087cee9f2db352ed2292e781c278510d8cb4c86b9582e9af4eb56a705e0f
7
+ data.tar.gz: 7d95d25ff6b670c3bd0a2ac6a295a4ef085bbde7479a40fdb0fece4100d1e2a76ba3ab814b0225de007f748f1c6d0f3c0d7b36df1b4010a11dad3951570d90b9
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '39 12 * * 0'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v2
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v1
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v1
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v1
@@ -11,7 +11,7 @@ jobs:
11
11
  strategy:
12
12
  fail-fast: false
13
13
  matrix:
14
- ruby: [2.6, 2.7, 3.0]
14
+ ruby: [2.6, 2.7, 3.0, 3.1]
15
15
 
16
16
  runs-on: ubuntu-latest
17
17
 
data/.rubocop.yml CHANGED
@@ -58,6 +58,8 @@ Style/KeywordParametersOrder:
58
58
  Enabled: false
59
59
  Gemspec/DateAssignment:
60
60
  Enabled: true
61
+ Gemspec/RequireMFA:
62
+ Enabled: true
61
63
  Layout/LineEndStringConcatenationIndentation:
62
64
  Enabled: true
63
65
  Layout/SpaceBeforeBrackets:
@@ -104,6 +106,8 @@ Lint/UnexpectedBlockArity:
104
106
  Enabled: true
105
107
  Lint/UnmodifiedReduceAccumulator:
106
108
  Enabled: true
109
+ Lint/UselessRuby2Keywords:
110
+ Enabled: true
107
111
  Security/IoMethods:
108
112
  Enabled: true
109
113
  Style/ArgumentsForwarding:
@@ -144,3 +148,5 @@ Style/StringChars:
144
148
  Enabled: true
145
149
  Style/SwapValues:
146
150
  Enabled: true
151
+ Style/OpenStructUse:
152
+ Enabled: true
data/CHANGELOG.md CHANGED
@@ -10,6 +10,31 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [5.1.0] - 2021-12-25
14
+
15
+ ### Enhancements
16
+ - Make default pointerType `touch` for the pointer in W3C actions instead of `mouse` for Appium
17
+ - This change should not affect W3C actions
18
+
19
+ ## [5.0.3] - 2021-12-13
20
+
21
+ ### Enhancements
22
+ - Can add more arguments in `install_app`
23
+ - e.g. Add `timeoutMs` for XCUITest driver as `@driver.install_app("/path/to/test.ipa", timeoutMs: 20000)`
24
+
25
+ ### Bug fixes
26
+ - (internal) Allow to access to `bridge` attribute in `driver` instance for appium_flutter_finder
27
+
28
+ ## [5.0.2] - 2021-12-01
29
+
30
+ ### Bug fixes
31
+ - (internal) Fix firstMatch format in a new session creation
32
+
33
+ ## [5.0.1] - 2021-11-23
34
+
35
+ ### Enhancements
36
+ - Relaxed version restriction of selenium-webdriver
37
+
13
38
  ## [5.0.0] - 2021-11-05
14
39
 
15
40
  ### Enhancements
data/README.md CHANGED
@@ -15,7 +15,7 @@ This library wraps [selenium-webdriver](https://github.com/SeleniumHQ/selenium/w
15
15
 
16
16
  # Migration from v4 to v5
17
17
 
18
- Please read `[5.0.0]` section in CHANGELOG.md
18
+ Please read [`[5.0.0]`](CHANGELOG.md#500---2021-11-05) section in [CHANGELOG](CHANGELOG.md)
19
19
 
20
20
  # Related library
21
21
  - https://github.com/appium/ruby_lib
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_runtime_dependency 'selenium-webdriver', '~> 4.0.0'
25
+ spec.add_runtime_dependency 'selenium-webdriver', '~> 4.0'
26
26
  spec.add_runtime_dependency 'faye-websocket', '~> 0.11.0'
27
27
 
28
28
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -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.14.0'
33
- spec.add_development_dependency 'rubocop', '1.22.3'
33
+ spec.add_development_dependency 'rubocop', '1.24.0'
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'
@@ -77,8 +77,8 @@ module Appium
77
77
  def create_session(capabilities)
78
78
  @available_commands = ::Appium::Core::Commands::COMMANDS.dup
79
79
 
80
- caps = add_appium_prefix(capabilities)
81
- response = execute(:new_session, {}, { capabilities: { alwaysMatch: caps, firstMatch: [] } })
80
+ always_match = add_appium_prefix(capabilities)
81
+ response = execute(:new_session, {}, { capabilities: { alwaysMatch: always_match, firstMatch: [{}] } })
82
82
 
83
83
  @session_id = response['sessionId']
84
84
  raise ::Selenium::WebDriver::Error::WebDriverError, 'no sessionId in returned payload' unless @session_id
@@ -159,8 +159,7 @@ module Appium
159
159
  # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html
160
160
  # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/KeyActions.html
161
161
  #
162
- # 'mouse' action is by default in the Ruby client. Appium server force the +mouse+ action to +touch+ once in
163
- # the server side. So we don't consider the case.
162
+ # The pointer type is 'touch' by default in the Appium Ruby client. (The selenium one is 'mouse')
164
163
  #
165
164
  # @example
166
165
  #
@@ -168,9 +167,14 @@ module Appium
168
167
  # @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
169
168
  #
170
169
  def action(async = false)
171
- # Used for default duration of each touch actions
172
- # Override from 250 milliseconds to 50 milliseconds
173
- action_builder = super
170
+ action_builder = ::Selenium::WebDriver::ActionBuilder.new(
171
+ self,
172
+ ::Selenium::WebDriver::Interactions.pointer(:touch, name: 'touch'),
173
+ ::Selenium::WebDriver::Interactions.key('keyboard'),
174
+ async
175
+ )
176
+ # Used for default duration of each touch actions.
177
+ # Override from 250 milliseconds to 50 milliseconds in PointerActions included by ::Selenium::WebDriver::ActionBuilder
174
178
  action_builder.default_move_duration = 0.05
175
179
  action_builder
176
180
  end
@@ -41,12 +41,12 @@ module Appium
41
41
 
42
42
  include ::Appium::Core::Waitable
43
43
 
44
- private
45
-
46
44
  # Private API.
47
45
  # Do not use this for general use. Used by flutter driver to get bridge for creating a new element
48
46
  attr_reader :bridge
49
47
 
48
+ private
49
+
50
50
  def initialize(bridge: nil, listener: nil, **opts)
51
51
  # For ::Appium::Core::Waitable
52
52
  @wait_timeout = opts.delete(:wait_timeout)
@@ -609,7 +609,9 @@ module Appium
609
609
  @bridge.background_app(duration)
610
610
  end
611
611
 
612
- # Install the given app onto the device
612
+ # Install the given app onto the device.
613
+ # Each options can be snake-case or camel-case. Snake-cases will be converted to camel-case
614
+ # as options value.
613
615
  #
614
616
  # @param [String] path The absolute local path or remote http URL to an .ipa or .apk file,
615
617
  # or a .zip containing one of these.
@@ -623,26 +625,26 @@ module Appium
623
625
  # @param [Boolean] grant_permissions Only for Android. whether to automatically grant application permissions
624
626
  # on Android 6+ after the installation completes. +false+ by default
625
627
  #
628
+ # Other parameters such as https://github.com/appium/appium-xcuitest-driver#mobile-installapp also can be set.
629
+ # Then, arguments in snake case will be camel case as its request parameters.
630
+ #
626
631
  # @example
627
632
  #
628
633
  # @driver.install_app("/path/to/test.apk")
629
634
  # @driver.install_app("/path/to/test.apk", replace: true, timeout: 20000, allow_test_packages: true,
630
635
  # use_sdcard: false, grant_permissions: false)
636
+ # @driver.install_app("/path/to/test.ipa", timeoutMs: 20000)
631
637
  #
632
- def install_app(path,
633
- replace: nil,
634
- timeout: nil,
635
- allow_test_packages: nil,
636
- use_sdcard: nil,
637
- grant_permissions: nil)
638
- @bridge.install_app(path,
639
- replace: replace,
640
- timeout: timeout,
641
- allow_test_packages: allow_test_packages,
642
- use_sdcard: use_sdcard,
643
- grant_permissions: grant_permissions)
638
+ def install_app(path, **options)
639
+ options = options.transform_keys { |key| key.to_s.gsub(/_./) { |v| v[1].upcase } } unless options.nil?
640
+ @bridge.install_app(path, options)
644
641
  end
645
642
 
643
+ # def capitalize(s)
644
+ # chars =
645
+ # chars[1:].map(&:capitalize).join
646
+ # end
647
+
646
648
  # @param [Strong] app_id BundleId for iOS or package name for Android
647
649
  # @param [Boolean] keep_data Only for Android. Whether to keep application data and caches after it is uninstalled.
648
650
  # +false+ by default
@@ -39,21 +39,9 @@ module Appium
39
39
  raise NotImplementedError
40
40
  end
41
41
 
42
- def install_app(path,
43
- replace: nil,
44
- timeout: nil,
45
- allow_test_packages: nil,
46
- use_sdcard: nil,
47
- grant_permissions: nil)
42
+ def install_app(path, options = {})
48
43
  args = { appPath: path }
49
-
50
- args[:options] = {} if options?(replace, timeout, allow_test_packages, use_sdcard, grant_permissions)
51
-
52
- args[:options][:replace] = replace unless replace.nil?
53
- args[:options][:timeout] = timeout unless timeout.nil?
54
- args[:options][:allowTestPackages] = allow_test_packages unless allow_test_packages.nil?
55
- args[:options][:useSdcard] = use_sdcard unless use_sdcard.nil?
56
- args[:options][:grantPermissions] = grant_permissions unless grant_permissions.nil?
44
+ args[:options] = options unless options.empty?
57
45
 
58
46
  execute :install_app, {}, args
59
47
  end
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '5.0.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2021-11-05' unless defined? ::Appium::Core::DATE
17
+ VERSION = '5.1.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2021-12-25' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
data/release_notes.md CHANGED
@@ -1,3 +1,35 @@
1
+ #### v5.1.0 2021-12-25
2
+
3
+ - [b8b9f08](https://github.com/appium/ruby_lib_core/commit/b8b9f0858846279bbd993baa3aa4a8fdfc737b53) Release 5.1.0
4
+ - [5979999](https://github.com/appium/ruby_lib_core/commit/59799994e91e126d57ce2cfd5b1446c48b381638) ci: add ruby 3.1 (#365)
5
+ - [6df37c7](https://github.com/appium/ruby_lib_core/commit/6df37c7928b125295e657f007e6c6c135090ac82) chore: tune w3c actions (#364)
6
+ - [1fdb794](https://github.com/appium/ruby_lib_core/commit/1fdb794153d74e54ca730d78eb38a59f1e3b9c72) chore(deps-dev): update rubocop requirement from = 1.23.0 to = 1.24.0 (#363)
7
+
8
+
9
+ #### v5.0.3 2021-12-13
10
+
11
+ - [7cee1b3](https://github.com/appium/ruby_lib_core/commit/7cee1b31647c453a546c450c35c37649462eed05) Release 5.0.3
12
+ - [21bd5a5](https://github.com/appium/ruby_lib_core/commit/21bd5a5186dc25a9523ad8e7ec6275edbc79988e) fix: make bridge attribute non-private for flutter finder (#362)
13
+ - [78e432e](https://github.com/appium/ruby_lib_core/commit/78e432e92571adfd80fe3ad4405010825e766fc5) chore: add changelog
14
+ - [0b3c45c](https://github.com/appium/ruby_lib_core/commit/0b3c45cd6a059fd493bfcbd55ebe437291cbcdab) feat: do not restrict options in install_app (#361)
15
+
16
+
17
+ #### v5.0.2 2021-12-01
18
+
19
+ - [3cc0fb1](https://github.com/appium/ruby_lib_core/commit/3cc0fb129a0ec74367c716941adefae75fe6a6d6) Release 5.0.2
20
+ - [a87c63a](https://github.com/appium/ruby_lib_core/commit/a87c63a5e00ca826eb89cee3b4874c4bbb787980) chore: tweak naming
21
+ - [36e50b2](https://github.com/appium/ruby_lib_core/commit/36e50b28c04a5afda8d25f6b855d35fda5ff6b2b) fix: sends [{}] (#360)
22
+
23
+
24
+ #### v5.0.1 2021-11-23
25
+
26
+ - [f17ba52](https://github.com/appium/ruby_lib_core/commit/f17ba524608a6e715923331bb9bfff73e0709bcb) Release 5.0.1
27
+ - [ee9cbc4](https://github.com/appium/ruby_lib_core/commit/ee9cbc42e0d3289bb4ab9b403d45867472241e97) feat: relax selenium webdriver version (#357)
28
+ - [4c2948b](https://github.com/appium/ruby_lib_core/commit/4c2948b113106e01c8009555434b4d0fe0ae99f3) chore(deps-dev): update rubocop requirement from = 1.22.3 to = 1.23.0 (#354)
29
+ - [abe2316](https://github.com/appium/ruby_lib_core/commit/abe2316b5a01a27bc657daeb41524afca4187c18) ci: add codeql-analysis (#355)
30
+ - [1c87fc9](https://github.com/appium/ruby_lib_core/commit/1c87fc9b2e1ac7bd869ec61a0dc045b12d5ed887) docs: add link to changelog in migration guide
31
+
32
+
1
33
  #### v5.0.0 2021-11-05
2
34
 
3
35
  - [e2d1e2d](https://github.com/appium/ruby_lib_core/commit/e2d1e2da59b10f84b3c8ecafba7be6ab27223b73) Release 5.0.0
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.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-05 00:00:00.000000000 Z
11
+ date: 2021-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faye-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.22.3
117
+ version: 1.24.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.22.3
124
+ version: 1.24.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: appium_thor
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -175,6 +175,7 @@ files:
175
175
  - ".github/contributing.md"
176
176
  - ".github/dependabot.yml"
177
177
  - ".github/issue_template.md"
178
+ - ".github/workflows/codeql-analysis.yml"
178
179
  - ".github/workflows/unittest.yml"
179
180
  - ".gitignore"
180
181
  - ".rubocop.yml"