appium_lib_core 3.9.0 → 4.0.0

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
  SHA256:
3
- metadata.gz: 3460051d458ee50ac23d5a2d6ebf9d5404382a63740de60e2c51284db5da7418
4
- data.tar.gz: bf58c7552b40d2461fc03bf0f06eb1845cc04c801f6bafa4e13d1f8448627c73
3
+ metadata.gz: 07d7884585b175caa13e4ad33176a963a78737d57471ff32c7d6453782d3128d
4
+ data.tar.gz: 59b0b7f2e2e37b6bfa4ea35cae2186cfa9bd94605e970139caba40f93ebcfa21
5
5
  SHA512:
6
- metadata.gz: 16368ab0315f00e08232551751422cc5cbfe89e0c0b5b046d8ac3543e5c3d3253c4a27f50cadb7b7c6209df6d06e52bcfc7861bdee3126ab44e568950301da14
7
- data.tar.gz: e5b0b72438585da43ba935584aeb58c0c17d3ce8463b724565afaa52260a2cd6e0c8727e89f219723d3c96aac527ca70b9b8f6ee49d7ef5f0f40f42d15e6c8c9
6
+ metadata.gz: 1e70907610689a1790bad3ddd1cbe651053d2752ee16ec4d6d67f7ca32c62d3445f0ed6a78ec70da1dad4c171ad66508e396b4d96afe5b015fa69ce713872aaa
7
+ data.tar.gz: 8b86523f38bfd66efb73f4aade5863e22106621d18e40ba6e9e05f94af14ecf254bb51309ea1785f8c96687a4efee6c35b51ad570946ada0978f1c6bd82752f2
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: issue report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## This is a
11
+ * [ ] Bug report
12
+ * [ ] Question
13
+ * [ ] Feature Request
14
+
15
+ ## Summary
16
+
17
+ ## Environment
18
+ * `ruby_lib_core` version:
19
+ * Mobile platform/version/device under test:
20
+
21
+ ## Actual behaviour and steps to reproduce
22
+
23
+ ## Expected behaviour
24
+
25
+ ## Link to Appium/Ruby logs
26
+
27
+ Create a [GIST](https://gist.github.com) which is a paste of your _full_ Appium logs, and link them here.
28
+
29
+ ## Any additional comments
@@ -0,0 +1,68 @@
1
+ name: Runs lint and unit tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [2.4, 2.5, 2.6, 2.7]
15
+
16
+ runs-on: ubuntu-latest
17
+
18
+ env:
19
+ UNIT_TEST: true
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ - name: Install dependencies
28
+ run: bundle install
29
+ - name: Run tests
30
+ run: |
31
+ bundle exec rake rubocop
32
+ bundle exec parallel_test test/unit/ -n 4
33
+ AUTOMATION_NAME_DROID=espresso bundle exec parallel_test test/unit/android -n 4
34
+ AUTOMATION_NAME_DROID=appium AUTOMATION_NAME_IOS=appium bundle exec parallel_test test/unit -n 4
35
+
36
+ test-win:
37
+ strategy:
38
+ fail-fast: false
39
+ matrix:
40
+ # Does not add 2.7 on Windows so far since a command fails only on Windows
41
+ ruby: [2.4, 2.5, 2.6]
42
+
43
+ runs-on: windows-latest
44
+
45
+ env:
46
+ UNIT_TEST: true
47
+
48
+ steps:
49
+ - uses: actions/checkout@v2
50
+ - name: Set up Ruby
51
+ uses: ruby/setup-ruby@v1
52
+ with:
53
+ ruby-version: ${{ matrix.ruby }}
54
+ - name: Install dependencies
55
+ run: |
56
+ gem install ffi
57
+ bundle install
58
+ gem uninstall --force eventmachine && gem install eventmachine --platform ruby
59
+ - name: Run tests
60
+ run: |
61
+ parallel_test test/unit/ -n 4
62
+
63
+ setx AUTOMATION_NAME_DROID espresso
64
+ parallel_test test/unit/android -n 4
65
+
66
+ setx AUTOMATION_NAME_DROID appium
67
+ setx AUTOMATION_NAME_IOS appium
68
+ parallel_test test/unit -n 4
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.4
3
3
  Metrics/LineLength:
4
4
  Max: 128
5
5
  Metrics/MethodLength:
@@ -11,16 +11,13 @@ Metrics/ClassLength:
11
11
  Metrics/AbcSize:
12
12
  Enabled: false
13
13
  Metrics/CyclomaticComplexity:
14
- Max: 13
14
+ Max: 14
15
15
  Metrics/PerceivedComplexity:
16
- Max: 13
16
+ Max: 14
17
17
  Metrics/ParameterLists:
18
18
  Enabled: false
19
19
  Lint/NestedMethodDefinition:
20
20
  Enabled: false
21
- # TODO: Replace <<- with <<~ after dropping Ruby 2.2
22
- Layout/IndentHeredoc:
23
- Enabled: false
24
21
  Style/ZeroLengthPredicate:
25
22
  Enabled: false
26
23
  Style/Documentation:
@@ -33,8 +30,7 @@ Style/BracesAroundHashParameters:
33
30
  Enabled: false
34
31
  Style/SymbolArray:
35
32
  Enabled: false
36
- # TODO: will remove after stopping support 2.2
37
- Style/NumericPredicate:
33
+ Style/UnpackFirst:
38
34
  Enabled: false
39
35
  Naming/AccessorMethodName:
40
36
  Enabled: false
@@ -10,6 +10,54 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [4.0.0] - 2020-12-19
14
+
15
+ Supported Ruby version is 2.4+
16
+
17
+ ### Enhancements
18
+
19
+ ### Bug fixes
20
+
21
+ ### Deprecations
22
+ - No longer work with `forceMjsonwp` capability to force the session MJSONWP
23
+
24
+ ## [3.11.1] - 2020-11-20
25
+
26
+ ### Enhancements
27
+
28
+ ### Bug fixes
29
+ - Fix `install_app` to be able to set no args for options
30
+
31
+ ### Deprecations
32
+
33
+ ## [3.11.0] - 2020-08-01
34
+
35
+ ### Enhancements
36
+ - Security update [GHSA-2v5c-755p-p4gv](https://github.com/advisories/GHSA-2v5c-755p-p4gv)
37
+ - Affects only _::Appium::Core::WebSocket_
38
+
39
+ ### Bug fixes
40
+
41
+ ### Deprecations
42
+
43
+ ## [3.10.1] - 2020-06-29
44
+
45
+ ### Enhancements
46
+
47
+ ### Bug fixes
48
+ - Fix duplication warning of `execute_cdp`
49
+
50
+ ### Deprecations
51
+
52
+ ## [3.10.0] - 2020-06-09
53
+
54
+ ### Enhancements
55
+ - Remove deprecated `Selenium::WebDriver::Error::TimeOutError`
56
+
57
+ ### Bug fixes
58
+
59
+ ### Deprecations
60
+
13
61
  ## [3.9.0] - 2020-05-31
14
62
 
15
63
  ### Enhancements
@@ -48,7 +96,7 @@ Read `release_notes.md` for commit level details.
48
96
  ### Enhancements
49
97
  - Add `x-idempotency-key` header support (https://github.com/appium/appium-base-driver/pull/400)
50
98
  - Can disable the header with `enable_idempotency_header: false` in `appium_lib` capability. Defaults to `true`.
51
- - Add chrome devtools endpoint which is available chrome module in Selenium Ruby binding
99
+ - Add chrome devtools endpoint which is available chrome module in Selenium Ruby binding
52
100
  - https://github.com/appium/appium-base-driver/pull/405
53
101
 
54
102
  ### Bug fixes
@@ -140,7 +188,7 @@ Read `release_notes.md` for commit level details.
140
188
 
141
189
  ### Enhancements
142
190
  - Add `execute_driver` to run a batch script
143
- - It requires Appium version which has `execute_driver` support
191
+ - It requires Appium version which has `execute_driver` support
144
192
 
145
193
  ### Bug fixes
146
194
 
data/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/appium_lib_core.svg)](https://badge.fury.io/rb/appium_lib_core)
4
4
 
5
- | Travis, Ubuntu | Azure, Windows and functional tests |
6
- |:---:|:---:|
7
- |[![Build Status](https://travis-ci.org/appium/ruby_lib_core.svg?branch=master)](https://travis-ci.org/appium/ruby_lib_core)|[![Build Status](https://dev.azure.com/kazucocoa/ruby_lib_core/_apis/build/status/ruby_lib_core?branchName=master)](https://dev.azure.com/kazucocoa/ruby_lib_core/_build/latest?definitionId=9&branchName=master)|
5
+ [![Build Status](https://dev.azure.com/AppiumCI/Appium%20CI/_apis/build/status/appium.ruby_lib_core?branchName=master)](https://dev.azure.com/AppiumCI/Appium%20CI/_build/latest?definitionId=54&branchName=master)
8
6
 
9
7
  This library is a Ruby client for Appium. The gem is available via [appium_lib_core](https://rubygems.org/gems/appium_lib_core).
10
8
 
@@ -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.2'
7
+ spec.required_ruby_version = '>= 2.4'
8
8
 
9
9
  spec.name = 'appium_lib_core'
10
10
  spec.version = Appium::Core::VERSION
@@ -23,14 +23,14 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_runtime_dependency 'selenium-webdriver', '~> 3.14', '>= 3.14.1'
26
- spec.add_runtime_dependency 'faye-websocket', '~> 0.10.0'
26
+ spec.add_runtime_dependency 'faye-websocket', '~> 0.11.0'
27
27
 
28
28
  spec.add_development_dependency 'bundler', '>= 1.14'
29
29
  spec.add_development_dependency 'rake', '~> 13.0'
30
30
  spec.add_development_dependency 'yard', '~> 0.9.11'
31
31
  spec.add_development_dependency 'minitest', '~> 5.0'
32
32
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
33
- spec.add_development_dependency 'webmock', '~> 3.8.0'
33
+ spec.add_development_dependency 'webmock', '~> 3.11.0'
34
34
  spec.add_development_dependency 'rubocop', '0.68.1'
35
35
  spec.add_development_dependency 'appium_thor', '~> 1.0'
36
36
  spec.add_development_dependency 'pry'
@@ -4,26 +4,6 @@
4
4
  # https://docs.microsoft.com/azure/devops/pipelines/languages/ruby
5
5
  jobs:
6
6
  - template: ./ci-jobs/functional_test.yml
7
- - job: Run_unit_tests_on_Windows_environment
8
- pool:
9
- vmImage: 'vs2017-win2016'
10
- variables:
11
- UNIT_TEST: true
12
- steps:
13
- - task: UseRubyVersion@0
14
- inputs:
15
- versionSpec: '2.5'
16
- - script: gem install bundler ffi:1.10.0
17
- displayName: 'Gem install bundler and ffi for Windows environment'
18
- - script: bundle install --retry=3 --jobs=4
19
- displayName: 'Call bundle install'
20
- - script: gem uninstall --force eventmachine && gem install eventmachine --platform ruby
21
- displayName: 'bundle re-install eventmachine for Windows because of Windows environment issue'
22
- - script: parallel_test test/unit/ -n 4
23
- displayName: 'Run parallel_test test/unit/ -n 4'
24
- - template: ./ci-jobs/functional/publish_test_result.yml
25
- parameters:
26
- xcodeVersion: 'Run_unit_tests_on_Windows_environment'
27
7
 
28
8
  # Runs tests nightly to make sure they works against appium@beta
29
9
  schedules:
@@ -3,3 +3,5 @@ steps:
3
3
  displayName: Xcode Select ${{ parameters.xcodeVersion }}
4
4
  - script: xcrun simctl list
5
5
  displayName: List Installed Simulators
6
+ - script: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
7
+ displayName: Disable pasteboard automatic sync
@@ -3,7 +3,7 @@ steps:
3
3
  condition: always()
4
4
  inputs:
5
5
  testResultsFiles: 'test/reports/TEST-AppiumLibCoreTest*.xml'
6
- testRunTitle: ${{ parameters.title }}
6
+ testRunTitle: '$(Agent.JobName)'
7
7
  - task: ArchiveFiles@2
8
8
  condition: always()
9
9
  inputs:
@@ -15,4 +15,4 @@ steps:
15
15
  condition: always()
16
16
  inputs:
17
17
  pathtoPublish: '$(Build.ArtifactStagingDirectory)'
18
- artifactName: 'test reports'
18
+ artifactName: '$(Agent.JobName)'
@@ -12,8 +12,13 @@ steps:
12
12
  - task: UseRubyVersion@0
13
13
  inputs:
14
14
  versionSpec: '2.4' # so far, bundler does not work over 2.5 since it raises openssl error
15
- - script: nohup appium --relaxed-security &
15
+ - script: |
16
+ mkdir -p test/report
17
+ nohup appium --relaxed-security --log-timestamp --log-no-colors > test/report/appium.out 2>&1 &
16
18
  displayName: Run Appium in background
19
+ env:
20
+ JAVA_HOME: $(JAVA_HOME_11_X64)
21
+ PATH: $(JAVA_HOME_11_X64)/bin:$(PATH)
17
22
  - script: |
18
23
  gem install bundler;
19
24
  bundle install --retry=3 --jobs=4 --path vendor/bundle;
@@ -18,7 +18,7 @@ echo ${ANDROID_HOME}/emulator/emulator -list-avds
18
18
  echo "Starting emulator"
19
19
 
20
20
  # Start emulator in background
21
- nohup ${ANDROID_HOME}/emulator/emulator -avd testemulator -accel auto -no-boot-anim -no-snapshot > /dev/null 2>&1 &
21
+ nohup ${ANDROID_HOME}/emulator/emulator -avd testemulator -accel auto -no-boot-anim -gpu auto -no-snapshot > /dev/null 2>&1 &
22
22
  ${ANDROID_HOME}/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
23
23
 
24
24
  ${ANDROID_HOME}/platform-tools/adb devices
@@ -2,13 +2,14 @@
2
2
  parameters:
3
3
  vmImage: 'macOS-10.15'
4
4
  vmImageForIOS: 'macOS-10.15' # Not sure the reason, but macOS 10.14 instance raises no info.plist error
5
- xcodeForIOS: 11.5
6
- xcodeForTVOS: 11.5
7
- androidSDK: 29
5
+ xcodeForIOS: 12.2
6
+ xcodeForTVOS: 12.2
7
+ androidSDK: 30
8
8
  appiumVersion: 'beta'
9
9
  ignoreVersionSkip: true
10
10
  CI: true
11
11
 
12
+
12
13
  jobs:
13
14
  # Run unit tests on different Node versions
14
15
  - job: func_test_ios_base
@@ -24,10 +25,8 @@ jobs:
24
25
  xcodeVersion: ${{ parameters.xcodeForIOS }}
25
26
  - template: ./functional/run_appium.yml
26
27
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/driver_test.rb,test/functional/ios/patch_test.rb
27
- displayName: Run tests
28
+ displayName: Run tests func_test_ios_base
28
29
  - template: ./functional/publish_test_result.yml
29
- parameters:
30
- xcodeVersion: 'Run_func_test_on_iOS'
31
30
 
32
31
  - job: func_test_ios_webdriver1
33
32
  pool:
@@ -42,10 +41,8 @@ jobs:
42
41
  xcodeVersion: ${{ parameters.xcodeForIOS }}
43
42
  - template: ./functional/run_appium.yml
44
43
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/webdriver/create_session_test.rb,test/functional/ios/webdriver/w3c_actions_test.rb
45
- displayName: Run tests
44
+ displayName: Run tests func_test_ios_webdriver1
46
45
  - template: ./functional/publish_test_result.yml
47
- parameters:
48
- xcodeVersion: 'Run_func_test_on_iOS_webdriver1'
49
46
 
50
47
  - job: func_test_ios_webdriver2
51
48
  pool:
@@ -60,10 +57,8 @@ jobs:
60
57
  xcodeVersion: ${{ parameters.xcodeForIOS }}
61
58
  - template: ./functional/run_appium.yml
62
59
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/webdriver/device_test.rb
63
- displayName: Run tests
60
+ displayName: Run tests func_test_ios_webdriver2
64
61
  - template: ./functional/publish_test_result.yml
65
- parameters:
66
- xcodeVersion: 'Run_func_test_on_iOS_webdriver2'
67
62
 
68
63
  - job: func_test_ios_ios1
69
64
  pool:
@@ -78,10 +73,8 @@ jobs:
78
73
  xcodeVersion: ${{ parameters.xcodeForIOS }}
79
74
  - template: ./functional/run_appium.yml
80
75
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/device_test.rb
81
- displayName: Run tests
76
+ displayName: Run tests func_test_ios_ios1
82
77
  - template: ./functional/publish_test_result.yml
83
- parameters:
84
- xcodeVersion: 'Run_func_test_on_iOS_ios1'
85
78
 
86
79
  - job: func_test_ios_ios2
87
80
  pool:
@@ -96,10 +89,8 @@ jobs:
96
89
  xcodeVersion: ${{ parameters.xcodeForIOS }}
97
90
  - template: ./functional/run_appium.yml
98
91
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/device_wda_attachment_test.rb,test/functional/ios/ios/search_context_test.rb
99
- displayName: Run tests
92
+ displayName: Run tests func_test_ios_ios2
100
93
  - template: ./functional/publish_test_result.yml
101
- parameters:
102
- xcodeVersion: 'Run_func_test_on_iOS_ios2'
103
94
 
104
95
  - job: func_test_ios_ios3
105
96
  pool:
@@ -116,10 +107,8 @@ jobs:
116
107
  displayName: Install ffmpeg and applesimutils
117
108
  - template: ./functional/run_appium.yml
118
109
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/mjpeg_server_test.rb,test/functional/ios/ios/mobile_commands_test.rb
119
- displayName: Run tests
110
+ displayName: Run tests func_test_ios_ios3
120
111
  - template: ./functional/publish_test_result.yml
121
- parameters:
122
- xcodeVersion: 'Run_func_test_on_iOS_ios3'
123
112
 
124
113
  - job: func_test_ios_tvos
125
114
  pool:
@@ -134,10 +123,8 @@ jobs:
134
123
  xcodeVersion: ${{ parameters.xcodeForTVOS }}
135
124
  - template: ./functional/run_appium.yml
136
125
  - script: bundle exec rake test:func:ios TESTS=test/functional/ios/tv_driver_test.rb
137
- displayName: Run tests
126
+ displayName: Run tests func_test_ios_tvos
138
127
  - template: ./functional/publish_test_result.yml
139
- parameters:
140
- xcodeVersion: 'Run_func_test_on_iOS_tv'
141
128
 
142
129
  # Skip since opencv4nodejs fails to install on the macOS instance
143
130
  # - job: func_test_ios_opencv
@@ -157,8 +144,6 @@ jobs:
157
144
  # - script: bundle exec rake test:func:ios test/functional/ios/ios/image_comparison_test.rb
158
145
  # displayName: Run tests
159
146
  # - template: ./functional/publish_test_result.yml
160
- # parameters:
161
- # xcodeVersion: 'Run_func_test_on_iOS_opencv'
162
147
 
163
148
 
164
149
  - job: func_test_android_base
@@ -179,10 +164,8 @@ jobs:
179
164
  - template: ./functional/android_setup.yml
180
165
  - template: ./functional/run_appium.yml
181
166
  - script: bundle exec rake test:func:android TESTS=test/functional/android/driver_test.rb,test/functional/android/patch_test.rb
182
- displayName: Run tests
167
+ displayName: Run tests func_test_android_base
183
168
  - template: ./functional/publish_test_result.yml
184
- parameters:
185
- xcodeVersion: 'Run_func_test_on_android_base'
186
169
 
187
170
  - job: func_test_android_webdriver
188
171
  pool:
@@ -202,10 +185,8 @@ jobs:
202
185
  - template: ./functional/android_setup.yml
203
186
  - template: ./functional/run_appium.yml
204
187
  - script: bundle exec rake test:func:android TESTS=test/functional/android/webdriver/create_session_test.rb,test/functional/android/webdriver/device_test.rb,test/functional/android/webdriver/w3c_actions_test.rb
205
- displayName: Run tests
188
+ displayName: Run tests func_test_android_webdriver
206
189
  - template: ./functional/publish_test_result.yml
207
- parameters:
208
- xcodeVersion: 'Run_func_test_on_android_base'
209
190
 
210
191
  - job: func_test_android_android1
211
192
  pool:
@@ -225,10 +206,8 @@ jobs:
225
206
  - template: ./functional/android_setup.yml
226
207
  - template: ./functional/run_appium.yml
227
208
  - script: bundle exec rake test:func:android TESTS=test/functional/android/android/device_test.rb
228
- displayName: Run test/functional/android/android/device_test.rb
209
+ displayName: Run tests func_test_android_android1
229
210
  - template: ./functional/publish_test_result.yml
230
- parameters:
231
- xcodeVersion: 'func_test_android_android1'
232
211
 
233
212
  - job: func_test_android_android2
234
213
  pool:
@@ -247,11 +226,9 @@ jobs:
247
226
  steps:
248
227
  - template: ./functional/android_setup.yml
249
228
  - template: ./functional/run_appium.yml
250
- - script: bundle exec rake test:func:android TESTS=test/functional/android/android/mobile_commands_test.rb,test/functional/android/android/search_context_test.rb,test/functional/android/android/mjpeg_server_test.rb
251
- displayName: Run tests
229
+ - script: bundle exec rake test:func:android TESTS=test/functional/android/android/search_context_test.rb,test/functional/android/android/mjpeg_server_test.rb
230
+ displayName: Run tests func_test_android_android2
252
231
  - template: ./functional/publish_test_result.yml
253
- parameters:
254
- xcodeVersion: 'func_test_android_android3'
255
232
 
256
233
  - job: func_test_android_android3
257
234
  pool:
@@ -271,10 +248,8 @@ jobs:
271
248
  - template: ./functional/android_setup.yml
272
249
  - template: ./functional/run_appium.yml
273
250
  - script: bundle exec rake test:func:android TESTS=test/functional/android/android/device_data_test.rb
274
- displayName: Run tests
251
+ displayName: Run tests func_test_android_android3
275
252
  - template: ./functional/publish_test_result.yml
276
- parameters:
277
- xcodeVersion: 'func_test_android_android3'
278
253
 
279
254
  - job: func_test_android_mobile_command_espresso
280
255
  pool:
@@ -295,10 +270,8 @@ jobs:
295
270
  - template: ./functional/android_setup.yml
296
271
  - template: ./functional/run_appium.yml
297
272
  - script: bundle exec rake test:func:android TESTS=test/functional/android/android/mobile_commands_test.rb
298
- displayName: Run tests
273
+ displayName: Run tests func_test_android_mobile_command_espresso
299
274
  - template: ./functional/publish_test_result.yml
300
- parameters:
301
- xcodeVersion: 'func_test_android_mobile_command_espresso'
302
275
 
303
276
  # Skip since opencv4nodejs fails to install on the macOS instance
304
277
  # - job: func_test_android_opencv
@@ -321,7 +294,5 @@ jobs:
321
294
  # - script: npm install -g opencv4nodejs@5.1.0
322
295
  # displayName: Install opencv4nodejs@5.1.0
323
296
  # - script: bundle exec rake test:func:android TESTS=test/functional/android/android/image_comparison_test.rb
324
- # displayName: Run tests
297
+ # displayName: Run tests func_test_android_opencv
325
298
  # - template: ./functional/publish_test_result.yml
326
- # parameters:
327
- # xcodeVersion: 'func_test_android_android2'
@@ -412,6 +412,9 @@ module Appium
412
412
  end
413
413
 
414
414
  ::Appium::Core::Device.add_endpoint_method(:execute_cdp) do
415
+ # SeleniumWebdriver could already define this method
416
+ return if method_defined? :execute_cdp
417
+
415
418
  def execute_cdp(cmd, **params)
416
419
  execute :chrome_send_command, {}, { cmd: cmd, params: params }
417
420
  end
@@ -60,9 +60,6 @@ module Appium
60
60
  # Creates session handling both OSS and W3C dialects.
61
61
  # Copy from Selenium::WebDriver::Remote::Bridge to keep using +merged_capabilities+ for Appium
62
62
  #
63
- # If +desired_capabilities+ has +forceMjsonwp: true+ in the capability, this bridge works with mjsonwp protocol.
64
- # If +forceMjsonwp: false+ or no the capability, it depends on server side whether this bridge works as w3c or mjsonwp.
65
- #
66
63
  # @param [::Selenium::WebDriver::Remote::W3C::Capabilities, Hash] desired_capabilities A capability
67
64
  # @return [::Selenium::WebDriver::Remote::Capabilities, ::Selenium::WebDriver::Remote::W3C::Capabilities]
68
65
  #
@@ -76,25 +73,6 @@ module Appium
76
73
  # platformVersion: '11.4',
77
74
  # deviceName: 'iPhone Simulator',
78
75
  # useNewWDA: true,
79
- # forceMjsonwp: true
80
- # },
81
- # appium_lib: {
82
- # wait: 30
83
- # }
84
- # }
85
- # core = ::Appium::Core.for(caps)
86
- # driver = core.start_driver #=> driver.dialect == :oss
87
- #
88
- # @example
89
- #
90
- # opts = {
91
- # caps: {
92
- # platformName: :ios,
93
- # automationName: 'XCUITest',
94
- # app: 'test/functional/app/UICatalog.app.zip',
95
- # platformVersion: '11.4',
96
- # deviceName: 'iPhone Simulator',
97
- # useNewWDA: true,
98
76
  # },
99
77
  # appium_lib: {
100
78
  # wait: 30
@@ -194,21 +172,17 @@ module Appium
194
172
  force_mjsonwp = desired_capabilities[FORCE_MJSONWP]
195
173
  desired_capabilities = delete_force_mjsonwp(desired_capabilities) unless force_mjsonwp.nil?
196
174
 
197
- if force_mjsonwp
198
- {
199
- desiredCapabilities: desired_capabilities
200
- }
201
- else
202
- new_caps = add_appium_prefix(desired_capabilities)
203
- w3c_capabilities = ::Selenium::WebDriver::Remote::W3C::Capabilities.from_oss(new_caps)
204
-
205
- {
206
- desiredCapabilities: desired_capabilities,
207
- capabilities: {
208
- firstMatch: [w3c_capabilities]
209
- }
175
+ ::Appium::Logger.warn "'forceMjsonwp' no longer works. Sending both W3C and MJSONWP capabilities" if force_mjsonwp
176
+
177
+ new_caps = add_appium_prefix(desired_capabilities)
178
+ w3c_capabilities = ::Selenium::WebDriver::Remote::W3C::Capabilities.from_oss(new_caps)
179
+
180
+ {
181
+ desiredCapabilities: desired_capabilities,
182
+ capabilities: {
183
+ firstMatch: [w3c_capabilities]
210
184
  }
211
- end
185
+ }
212
186
  end
213
187
  end # class Bridge
214
188
  end # class Base
@@ -135,8 +135,6 @@ module Appium
135
135
  by = _set_by_from_finders(how)
136
136
  begin
137
137
  bridge.find_element_by by, what.to_s, ref
138
- rescue Selenium::WebDriver::Error::TimeOutError # will deprecate
139
- raise Selenium::WebDriver::Error::NoSuchElementError
140
138
  rescue Selenium::WebDriver::Error::TimeoutError
141
139
  raise Selenium::WebDriver::Error::NoSuchElementError
142
140
  end
@@ -152,8 +150,6 @@ module Appium
152
150
  by = _set_by_from_finders(how)
153
151
  begin
154
152
  bridge.find_elements_by by, what.to_s, ref
155
- rescue Selenium::WebDriver::Error::TimeOutError # will deprecate
156
- []
157
153
  rescue Selenium::WebDriver::Error::TimeoutError
158
154
  []
159
155
  end
@@ -47,7 +47,7 @@ module Appium
47
47
  grant_permissions: nil)
48
48
  args = { appPath: path }
49
49
 
50
- args[:options] = {} unless options?(replace, timeout, allow_test_packages, use_sdcard, grant_permissions)
50
+ args[:options] = {} if options?(replace, timeout, allow_test_packages, use_sdcard, grant_permissions)
51
51
 
52
52
  args[:options][:replace] = replace unless replace.nil?
53
53
  args[:options][:timeout] = timeout unless timeout.nil?
@@ -92,8 +92,8 @@ module Appium
92
92
 
93
93
  private
94
94
 
95
- def options?(replace, timeout, allow_test_packages, use_sdcard, grant_permissions)
96
- replace.nil? || timeout.nil? || allow_test_packages.nil? || use_sdcard.nil? || grant_permissions.nil?
95
+ def options?(*args)
96
+ args.compact.any?
97
97
  end
98
98
  end # module AppManagement
99
99
  end # module Device
@@ -24,8 +24,8 @@ module Appium
24
24
  # @example
25
25
  #
26
26
  # @driver = Appium::Core.for(opts).start_driver
27
- # action_1 = TouchAction.new(@driver).press(x: 45, y: 100).wait(600).release
28
- # action_2 = TouchAction.new(@driver).tap(element: el, x: 50, y:5, count: 3)
27
+ # action_1 = Appium::Core::TouchAction.new(@driver).press(x: 45, y: 100).wait(600).release
28
+ # action_2 = Appium::Core::TouchAction.new(@driver).tap(element: el, x: 50, y:5, count: 3)
29
29
  #
30
30
  # multi_touch_action = MultiTouch.new(@driver)
31
31
  # multi_touch_action.add action_1
@@ -27,9 +27,9 @@ module Appium
27
27
  # @example
28
28
  #
29
29
  # @driver = Appium::Core.for(opts).start_driver
30
- # action = TouchAction.new(@driver).press(x: 45, y: 100).wait(600).release
30
+ # action = Appium::Core::TouchAction.new(@driver).press(x: 45, y: 100).wait(600).release
31
31
  # action.perform
32
- # action = TouchAction.new(@driver).swipe(....)
32
+ # action = Appium::Core::TouchAction.new(@driver).swipe(....)
33
33
  # action.perform
34
34
  #
35
35
  class TouchAction
@@ -59,7 +59,7 @@ module Appium
59
59
  # Press down for a specific duration.
60
60
  # Alternatively, you can use +press(...).wait(...).release()+ instead of +long_press+ if duration doesn't work well.
61
61
  # https://github.com/appium/ruby_lib/issues/231#issuecomment-269895512
62
- # e.g. Appium::TouchAction.new.press(x: 280, y: 530).wait(2000).release.perform
62
+ # e.g. Appium::Core::TouchAction.new.press(x: 280, y: 530).wait(2000).release.perform
63
63
  #
64
64
  # @param opts [Hash] Options
65
65
  # @option opts [WebDriver::Element] element the element to press.
@@ -494,7 +494,7 @@ module Appium
494
494
  private
495
495
 
496
496
  # @private
497
- def extend_for(device:, automation_name:)
497
+ def extend_for(device:, automation_name:) # rubocop:disable Metrics/CyclomaticComplexity
498
498
  extend Appium::Core
499
499
  extend Appium::Core::Device
500
500
 
@@ -505,21 +505,39 @@ module Appium
505
505
  ::Appium::Core::Android::Espresso::Bridge.for self
506
506
  when :uiautomator2
507
507
  ::Appium::Core::Android::Uiautomator2::Bridge.for self
508
+ when :gecko
509
+ ::Appium::Logger.debug('Gecko Driver for Android')
508
510
  else # default and UiAutomator
509
511
  ::Appium::Core::Android::Uiautomator1::Bridge.for self
510
512
  end
511
513
  when :ios, :tvos
512
514
  case automation_name
515
+ when :safari
516
+ ::Appium::Logger.debug('SafariDriver for iOS')
513
517
  when :xcuitest
514
518
  ::Appium::Core::Ios::Xcuitest::Bridge.for self
515
519
  else # default and UIAutomation
516
520
  ::Appium::Core::Ios::Uiautomation::Bridge.for self
517
521
  end
518
522
  when :mac
519
- # no Mac specific extentions
520
- ::Appium::Logger.debug('mac')
523
+ case automation_name
524
+ when :safari
525
+ ::Appium::Logger.debug('SafariDriver for macOS')
526
+ when :gecko
527
+ ::Appium::Logger.debug('Gecko Driver for macOS')
528
+ when :mac2
529
+ ::Appium::Logger.debug('macOS XCUITest')
530
+ else
531
+ # no Mac specific extentions
532
+ ::Appium::Logger.debug('macOS Native')
533
+ end
521
534
  when :windows
522
- ::Appium::Core::Windows::Bridge.for self
535
+ case automation_name
536
+ when :gecko
537
+ ::Appium::Logger.debug('Gecko Driver for Windows')
538
+ else
539
+ ::Appium::Core::Windows::Bridge.for self
540
+ end
523
541
  when :tizen
524
542
  # https://github.com/Samsung/appium-tizen-driver
525
543
  ::Appium::Logger.debug('tizen')
@@ -531,6 +549,8 @@ module Appium
531
549
  when :mac
532
550
  # In this case also can be mac
533
551
  ::Appium::Logger.debug('mac')
552
+ when :gecko # other general platform
553
+ ::Appium::Logger.debug('Gecko Driver')
534
554
  else
535
555
  ::Appium::Logger.warn("No matched driver by platformName: #{device} and automationName: #{automation_name}")
536
556
  end
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '3.9.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2020-05-31' unless defined? ::Appium::Core::DATE
17
+ VERSION = '4.0.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2020-12-19' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
@@ -1,3 +1,62 @@
1
+ #### v4.0.0 2020-12-19
2
+
3
+ - [66e2306](https://github.com/appium/ruby_lib_core/commit/66e23069722d5ccd9ca10f5a1bdf2733cb249a2c) Release 4.0.0
4
+ - [4ba9098](https://github.com/appium/ruby_lib_core/commit/4ba9098188b51d3534e35b0fae9340de7100f516) feat: drop forcemjsonwp (#291)
5
+ - [5df301c](https://github.com/appium/ruby_lib_core/commit/5df301cb559eed1431cc790655dc89c22be54eb9) chore(deps-dev): update webmock requirement from ~> 3.10.0 to ~> 3.11.0 (#290)
6
+ - [76c0ff7](https://github.com/appium/ruby_lib_core/commit/76c0ff7fa540261c5793cde1f79dc14bf752fd35) feat: bump supported ruby version (#289)
7
+ - [ea5dd00](https://github.com/appium/ruby_lib_core/commit/ea5dd0008a56821750a5b256b912f252dd46b78d) test: add a few steps
8
+ - [9c56f30](https://github.com/appium/ruby_lib_core/commit/9c56f302d46b2ea5d970c79536260720a6bd25ec) docs: add full module path in example
9
+ - [f88ae2c](https://github.com/appium/ruby_lib_core/commit/f88ae2c0d6e02d40089298e8bf5ec19b2af012cd) chore: Add mac2 sample and log (#288)
10
+ - [39e4611](https://github.com/appium/ruby_lib_core/commit/39e4611adac83dee85c21893fc1f904bf828f21e) ci: bump iOS versions (#287)
11
+ - [d76ebdd](https://github.com/appium/ruby_lib_core/commit/d76ebddf0d0f664e49a616a1f94425eba887245e) docs: update badge
12
+
13
+
14
+ #### v3.11.1 2020-11-20
15
+
16
+ - [4fe582c](https://github.com/appium/ruby_lib_core/commit/4fe582c1318c2b5de83fcf87e36d1fedab8ed81a) Release 3.11.1
17
+ - [e017ebc](https://github.com/appium/ruby_lib_core/commit/e017ebcaa8c50653e2f45871465c78ad5a8ce81e) fix: install_app args options bug (#286)
18
+ - [e7b881c](https://github.com/appium/ruby_lib_core/commit/e7b881c19be1b3a9acf7d01f34f59307b8e16b89) chore(deps-dev): update webmock requirement from ~> 3.9.1 to ~> 3.10.0 (#284)
19
+ - [d1e8cb8](https://github.com/appium/ruby_lib_core/commit/d1e8cb864f00d4f4bd307b523cc205ee2a636d33) feat: add safari and geckodriver (#283)
20
+ - [569ea09](https://github.com/appium/ruby_lib_core/commit/569ea09f7777dd2508f1919ddcf9b88aba272647) test: use predicate instead of name for 'value' (#282)
21
+ - [e4d63eb](https://github.com/appium/ruby_lib_core/commit/e4d63eb82248a79b41fbbc39db5b03cc35d447cd) ci: remove duplicated test running
22
+ - [30be7dc](https://github.com/appium/ruby_lib_core/commit/30be7dca0ec3cdcafa647899447387924970df34) test: fix tests
23
+ - [94d4250](https://github.com/appium/ruby_lib_core/commit/94d4250033107ff956a2b9c1f0b30fedba286b5d) test: remove a trick
24
+ - [6605f78](https://github.com/appium/ruby_lib_core/commit/6605f78fb0d996faad7f1e21f1876eab5184d430) test: tweak test cases
25
+ - [7dbbadb](https://github.com/appium/ruby_lib_core/commit/7dbbadbda69ee2f710393768fb994e8e43adb3bb) fix lint
26
+ - [7619052](https://github.com/appium/ruby_lib_core/commit/76190523c95e3f6a1ab9a9af48d60605d2f87266) tweak test cases
27
+ - [87cb224](https://github.com/appium/ruby_lib_core/commit/87cb224a3f32261823fd5bacd9349cbe2158b54c) chore(deps-dev): update webmock requirement from ~> 3.8.0 to ~> 3.9.1 (#281)
28
+ - [577a75a](https://github.com/appium/ruby_lib_core/commit/577a75a690b6f0688dead506c26704c82ea6f2e9) ci: update for espresso (#280)
29
+
30
+
31
+ #### v3.11.0 2020-08-01
32
+
33
+ - [0ed888e](https://github.com/appium/ruby_lib_core/commit/0ed888efd87def79cdb1ca922268b466485a2261) Release 3.11.0
34
+ - [f7dc534](https://github.com/appium/ruby_lib_core/commit/f7dc5349a48ac305df740f7be1f6e5f9b90e1e0e) chore: update faye-websocket (#279)
35
+ - [2fa2440](https://github.com/appium/ruby_lib_core/commit/2fa24404aa993c643191a2de0f8c2c800680ec5f) test: tweak espresso (#278)
36
+ - [ba7f71d](https://github.com/appium/ruby_lib_core/commit/ba7f71d82393b75d7119dbb50f8c0ae781d0933e) ci: revert
37
+ - [c2cf5d7](https://github.com/appium/ruby_lib_core/commit/c2cf5d7ef04c51e0b978676ea5145223f1b16f2e) test: add allOf example (#274)
38
+ - [f7c21b8](https://github.com/appium/ruby_lib_core/commit/f7c21b878ac9970f6d621deedf4c9adce7515700) ci: tweak version
39
+ - [2162392](https://github.com/appium/ruby_lib_core/commit/2162392bfa5cc949aae9b4020d6b53b7b23953f9) ci: specify which beta (#273)
40
+
41
+
42
+ #### v3.10.1 2020-06-29
43
+
44
+ - [9537c61](https://github.com/appium/ruby_lib_core/commit/9537c619220177a4cac82368405fec681a5ab231) Release 3.10.1
45
+ - [3b962f5](https://github.com/appium/ruby_lib_core/commit/3b962f55cc954699e72b38c94e5a1f05c82867f9) ci: runs tests on windows host as GitHub Actions (#272)
46
+ - [f60b4f1](https://github.com/appium/ruby_lib_core/commit/f60b4f193c590d861342828bd740cefda7e96b9a) ci: remove travis (#271)
47
+ - [b1aa80d](https://github.com/appium/ruby_lib_core/commit/b1aa80dd1cc200917df9958b6274e0a82b5ffc40) ci: run unittests on GitHub Actions (#270)
48
+ - [ad90f79](https://github.com/appium/ruby_lib_core/commit/ad90f79b726aa480edf989fed2a8b00ced6c52fd) chore: Update issue templates
49
+ - [cf546a0](https://github.com/appium/ruby_lib_core/commit/cf546a0c62f815df4bb3ece4932b8033fad25ae2) ci: tune Azure (#269)
50
+ - [14e7e56](https://github.com/appium/ruby_lib_core/commit/14e7e56a2bccb4c4cc53e0b10284e3837e50a1af) ci: bump android emulator version (#268)
51
+ - [8d2cd95](https://github.com/appium/ruby_lib_core/commit/8d2cd95445d95716617c426e759e19e861ef09e2) chore: remove pry added accidentally
52
+
53
+
54
+ #### v3.10.0 2020-06-09
55
+
56
+ - [9eff959](https://github.com/appium/ruby_lib_core/commit/9eff959240effde56460c77878a24a20d047f9e9) Release 3.10.0
57
+ - [0602e2a](https://github.com/appium/ruby_lib_core/commit/0602e2ab2b332f7db8e39b7da73707a50720fadd) feat: Remove timeout deprecated (#267)
58
+
59
+
1
60
  #### v3.9.0 2020-05-31
2
61
 
3
62
  - [f306188](https://github.com/appium/ruby_lib_core/commit/f306188102222088fbd31b0b9249c6a39ddd074f) Release 3.9.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: 3.9.0
4
+ version: 4.0.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: 2020-05-31 00:00:00.000000000 Z
11
+ date: 2020-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.10.0
39
+ version: 0.11.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.10.0
46
+ version: 0.11.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: 3.8.0
123
+ version: 3.11.0
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: 3.8.0
130
+ version: 3.11.0
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: rubocop
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -219,11 +219,12 @@ executables: []
219
219
  extensions: []
220
220
  extra_rdoc_files: []
221
221
  files:
222
+ - ".github/ISSUE_TEMPLATE/issue-report.md"
222
223
  - ".github/contributing.md"
223
224
  - ".github/issue_template.md"
225
+ - ".github/workflows/unittest.yml"
224
226
  - ".gitignore"
225
227
  - ".rubocop.yml"
226
- - ".travis.yml"
227
228
  - CHANGELOG.md
228
229
  - Gemfile
229
230
  - LICENSE.txt
@@ -332,14 +333,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
332
333
  requirements:
333
334
  - - ">="
334
335
  - !ruby/object:Gem::Version
335
- version: '2.2'
336
+ version: '2.4'
336
337
  required_rubygems_version: !ruby/object:Gem::Requirement
337
338
  requirements:
338
339
  - - ">="
339
340
  - !ruby/object:Gem::Version
340
341
  version: '0'
341
342
  requirements: []
342
- rubygems_version: 3.0.1
343
+ rubygems_version: 3.1.2
343
344
  signing_key:
344
345
  specification_version: 4
345
346
  summary: Minimal Ruby library for Appium.
@@ -1,24 +0,0 @@
1
- sudo: false
2
- cache: bundler
3
- language: ruby
4
- rvm:
5
- - 2.2
6
- - 2.3
7
- - 2.4
8
- - 2.5
9
- - 2.6
10
- - 2.7
11
-
12
- before_install:
13
- - gem update bundler
14
-
15
- script:
16
- - bundle exec rake rubocop
17
- - UNIT_TEST=true bundle exec parallel_test test/unit/ -n 4
18
- - UNIT_TEST=true AUTOMATION_NAME_DROID=espresso bundle exec parallel_test test/unit/android -n 4
19
- - UNIT_TEST=true AUTOMATION_NAME_DROID=appium AUTOMATION_NAME_IOS=appium bundle exec parallel_test test/unit -n 4
20
-
21
- notifications:
22
- email:
23
- on_success: never
24
- on_failure: never