Skip to content

Commit f516f76

Browse files
authored
ci: run with appium 2.0 (#359)
* ci: run with appium 2.0 * add --base-path * tweak env name * enable opencv stuff * tweak tests * adjust test
1 parent f3c2eea commit f516f76

File tree

8 files changed

+161
-117
lines changed

8 files changed

+161
-117
lines changed

.github/workflows/unittest.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
run: |
3131
bundle exec rake rubocop
3232
bundle exec rake test:unit
33-
AUTOMATION_NAME_DROID=espresso bundle exec rake test:unit:android
34-
AUTOMATION_NAME_DROID=appium AUTOMATION_NAME_IOS=appium bundle exec rake test:unit
33+
APPIUM_DRIVER=espresso bundle exec rake test:unit:android
34+
APPIUM_DRIVER=appium bundle exec rake test:unit
3535
3636
test-win:
3737
strategy:
@@ -59,9 +59,8 @@ jobs:
5959
run: |
6060
rake test:unit
6161
62-
setx AUTOMATION_NAME_DROID espresso
62+
setx APPIUM_DRIVER espresso
6363
rake test:unit:android
6464
65-
setx AUTOMATION_NAME_DROID appium
66-
setx AUTOMATION_NAME_IOS appium
65+
setx APPIUM_DRIVER appium
6766
rake test:unit

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $ appium --relaxed-security # To run all tests in local
4343
```bash
4444
$ bundle install
4545
$ rake test:func:android # Andorid, uiautomator2
46-
$ AUTOMATION_NAME_DROID=espresso rake test:func:android # Andorid, uiautomator2
46+
$ APPIUM_DRIVER=espresso rake test:func:android # Andorid, uiautomator2
4747
$ rake test:func:ios # iOS
4848
```
4949

ci-jobs/functional/run_appium.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ steps:
99
displayName: Install MJPEG Consumer
1010
- script: npm list --depth 2 -g || echo 'ok'
1111
displayName: Installed node dependencies
12+
- script: appium driver install ${APPIUM_DRIVER}
13+
displayName: Install appium driver ${APPIUM_DRIVER}
14+
- script: appium plugin install images
15+
- script: appium plugin install execute-driver
1216
- task: UseRubyVersion@0
1317
inputs:
1418
versionSpec: '3.0'
1519
- script: |
1620
mkdir -p test/report
17-
nohup appium --relaxed-security --log-timestamp --log-no-colors > test/report/appium.out 2>&1 &
21+
nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub > test/report/appium.out 2>&1 &
1822
displayName: Run Appium in background
1923
env:
2024
JAVA_HOME: $(JAVA_HOME_11_X64)

ci-jobs/functional_test.yml

+56-56
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
xcodeForIOS: 12.2
66
xcodeForTVOS: 12.2
77
androidSDK: 29 # API Level 30 emulators are more unstable than 29
8-
appiumVersion: 'beta'
8+
appiumVersion: 'next' # for appium 2 upstream
99
ignoreVersionSkip: true
1010
CI: true
1111

@@ -19,6 +19,7 @@ jobs:
1919
CI: ${{ parameters.ci }}
2020
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
2121
APPIUM_VERSION: ${{ parameters.appiumVersion }}
22+
APPIUM_DRIVER: xcuitest
2223
steps:
2324
- template: ./functional/ios_setup.yml
2425
parameters:
@@ -35,6 +36,7 @@ jobs:
3536
CI: ${{ parameters.ci }}
3637
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
3738
APPIUM_VERSION: ${{ parameters.appiumVersion }}
39+
APPIUM_DRIVER: xcuitest
3840
steps:
3941
- template: ./functional/ios_setup.yml
4042
parameters:
@@ -51,6 +53,7 @@ jobs:
5153
CI: ${{ parameters.ci }}
5254
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
5355
APPIUM_VERSION: ${{ parameters.appiumVersion }}
56+
APPIUM_DRIVER: xcuitest
5457
steps:
5558
- template: ./functional/ios_setup.yml
5659
parameters:
@@ -67,6 +70,7 @@ jobs:
6770
CI: ${{ parameters.ci }}
6871
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
6972
APPIUM_VERSION: ${{ parameters.appiumVersion }}
73+
APPIUM_DRIVER: xcuitest
7074
steps:
7175
- template: ./functional/ios_setup.yml
7276
parameters:
@@ -83,6 +87,7 @@ jobs:
8387
CI: ${{ parameters.ci }}
8488
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
8589
APPIUM_VERSION: ${{ parameters.appiumVersion }}
90+
APPIUM_DRIVER: xcuitest
8691
steps:
8792
- template: ./functional/ios_setup.yml
8893
parameters:
@@ -99,6 +104,7 @@ jobs:
99104
CI: ${{ parameters.ci }}
100105
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
101106
APPIUM_VERSION: ${{ parameters.appiumVersion }}
107+
APPIUM_DRIVER: xcuitest
102108
steps:
103109
- template: ./functional/ios_setup.yml
104110
parameters:
@@ -117,6 +123,7 @@ jobs:
117123
CI: ${{ parameters.ci }}
118124
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
119125
APPIUM_VERSION: ${{ parameters.appiumVersion }}
126+
APPIUM_DRIVER: xcuitest
120127
steps:
121128
- template: ./functional/ios_setup.yml
122129
parameters:
@@ -126,25 +133,22 @@ jobs:
126133
displayName: Run tests func_test_ios_tvos
127134
- template: ./functional/publish_test_result.yml
128135

129-
# Skip since opencv4nodejs fails to install on the macOS instance
130-
# - job: func_test_ios_opencv
131-
# pool:
132-
# vmImage: ${{ parameters.vmImageForIOS }}
133-
# variables:
134-
# CI: ${{ parameters.ci }}
135-
# IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
136-
# APPIUM_VERSION: ${{ parameters.appiumVersion }}
137-
# steps:
138-
# - template: ./functional/ios_setup.yml
139-
# parameters:
140-
# xcodeVersion: ${{ parameters.xcodeForIOS }}
141-
# - template: ./functional/run_appium.yml
142-
# - script: npm install -g opencv4nodejs@5.1.0
143-
# displayName: Install opencv4nodejs@5.1.0
144-
# - script: bundle exec rake test:func:ios test/functional/ios/ios/image_comparison_test.rb
145-
# displayName: Run tests
146-
# - template: ./functional/publish_test_result.yml
147-
136+
- job: func_test_ios_opencv
137+
pool:
138+
vmImage: ${{ parameters.vmImageForIOS }}
139+
variables:
140+
CI: ${{ parameters.ci }}
141+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
142+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
143+
APPIUM_DRIVER: xcuitest
144+
steps:
145+
- template: ./functional/ios_setup.yml
146+
parameters:
147+
xcodeVersion: ${{ parameters.xcodeForIOS }}
148+
- template: ./functional/run_appium.yml
149+
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/image_comparison_test.rb
150+
displayName: Run tests
151+
- template: ./functional/publish_test_result.yml
148152

149153
- job: func_test_android_base
150154
pool:
@@ -157,9 +161,9 @@ jobs:
157161
strategy:
158162
matrix:
159163
uiautomator2:
160-
AUTOMATION_NAME_DROID: 'uiautomator2'
164+
APPIUM_DRIVER: uiautomator2
161165
espresso:
162-
AUTOMATION_NAME_DROID: 'espresso'
166+
APPIUM_DRIVER: espresso
163167
steps:
164168
- template: ./functional/android_setup.yml
165169
- template: ./functional/run_appium.yml
@@ -178,9 +182,9 @@ jobs:
178182
strategy:
179183
matrix:
180184
uiautomator2:
181-
AUTOMATION_NAME_DROID: 'uiautomator2'
185+
APPIUM_DRIVER: uiautomator2
182186
espresso:
183-
AUTOMATION_NAME_DROID: 'espresso'
187+
APPIUM_DRIVER: espresso
184188
steps:
185189
- template: ./functional/android_setup.yml
186190
- template: ./functional/run_appium.yml
@@ -199,9 +203,9 @@ jobs:
199203
strategy:
200204
matrix:
201205
uiautomator2:
202-
AUTOMATION_NAME_DROID: 'uiautomator2'
206+
APPIUM_DRIVER: uiautomator2
203207
espresso:
204-
AUTOMATION_NAME_DROID: 'espresso'
208+
APPIUM_DRIVER: espresso
205209
steps:
206210
- template: ./functional/android_setup.yml
207211
- template: ./functional/run_appium.yml
@@ -220,9 +224,9 @@ jobs:
220224
strategy:
221225
matrix:
222226
uiautomator2:
223-
AUTOMATION_NAME_DROID: 'uiautomator2'
227+
APPIUM_DRIVER: uiautomator2
224228
espresso:
225-
AUTOMATION_NAME_DROID: 'espresso'
229+
APPIUM_DRIVER: espresso
226230
steps:
227231
- template: ./functional/android_setup.yml
228232
- template: ./functional/run_appium.yml
@@ -241,9 +245,9 @@ jobs:
241245
strategy:
242246
matrix:
243247
uiautomator2:
244-
AUTOMATION_NAME_DROID: 'uiautomator2'
248+
APPIUM_DRIVER: uiautomator2
245249
espresso:
246-
AUTOMATION_NAME_DROID: 'espresso'
250+
APPIUM_DRIVER: espresso
247251
steps:
248252
- template: ./functional/android_setup.yml
249253
- template: ./functional/run_appium.yml
@@ -257,42 +261,38 @@ jobs:
257261
variables:
258262
CI: ${{ parameters.ci }}
259263
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
260-
AUTOMATION_NAME_DROID: espresso
261264
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
262265
APPIUM_VERSION: ${{ parameters.appiumVersion }}
263266
strategy:
264267
matrix:
265268
uiautomator2:
266-
AUTOMATION_NAME_DROID: 'uiautomator2'
269+
APPIUM_DRIVER: uiautomator2
267270
espresso:
268-
AUTOMATION_NAME_DROID: 'espresso'
271+
APPIUM_DRIVER: espresso
269272
steps:
270273
- template: ./functional/android_setup.yml
271274
- template: ./functional/run_appium.yml
272275
- script: bundle exec rake test:func:android TESTS=test/functional/android/android/mobile_commands_test.rb
273276
displayName: Run tests func_test_android_mobile_command_espresso
274277
- template: ./functional/publish_test_result.yml
275278

276-
# Skip since opencv4nodejs fails to install on the macOS instance
277-
# - job: func_test_android_opencv
278-
# pool:
279-
# vmImage: ${{ parameters.vmImage }}
280-
# variables:
281-
# CI: ${{ parameters.ci }}
282-
# ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
283-
# IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
284-
# APPIUM_VERSION: ${{ parameters.appiumVersion }}
285-
# strategy:
286-
# matrix:
287-
# uiautomator2:
288-
# AUTOMATION_NAME_DROID: 'uiautomator2'
289-
# espresso:
290-
# AUTOMATION_NAME_DROID: 'espresso'
291-
# steps:
292-
# - template: ./functional/android_setup.yml
293-
# - template: ./functional/run_appium.yml
294-
# - script: npm install -g opencv4nodejs@5.1.0
295-
# displayName: Install opencv4nodejs@5.1.0
296-
# - script: bundle exec rake test:func:android TESTS=test/functional/android/android/image_comparison_test.rb
297-
# displayName: Run tests func_test_android_opencv
298-
# - template: ./functional/publish_test_result.yml
279+
- job: func_test_android_opencv
280+
pool:
281+
vmImage: ${{ parameters.vmImage }}
282+
variables:
283+
CI: ${{ parameters.ci }}
284+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
285+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
286+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
287+
strategy:
288+
matrix:
289+
uiautomator2:
290+
APPIUM_DRIVER: uiautomator2
291+
espresso:
292+
APPIUM_DRIVER: espresso
293+
steps:
294+
- template: ./functional/android_setup.yml
295+
- template: ./functional/run_appium.yml
296+
- script: bundle exec rake test:func:android TESTS=test/functional/android/android/image_comparison_test.rb
297+
displayName: Run tests func_test_android_opencv
298+
- template: ./functional/publish_test_result.yml

0 commit comments

Comments
 (0)