-
Notifications
You must be signed in to change notification settings - Fork 564
298 lines (252 loc) · 9.36 KB
/
functional-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
name: Functional Tests
on:
# Run by manual at this time
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ios_test:
strategy:
fail-fast: false
matrix:
test_targets:
- target: test/functional/ios/safari_tests.py
name: func_test_ios1
runs-on: macos-14
# Please make sure the available Xcode versions and iOS versions
# on the runner images. https://github.com/actions/runner-images
env:
XCODE_VERSION: 15.3
IOS_VERSION: 17.4
IPHONE_MODEL: iPhone 15 Plus
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
- uses: futureware-tech/simulator-action@v3
with:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
model: ${{ env.IPHONE_MODEL }}
os_version: ${{ env.IOS_VERSION }}
# needed?
- run: brew install ffmpeg
# Start Appium
- run: npm install -g appium
- run: |
appium driver install xcuitest
appium plugin install images
appium plugin install execute-driver
nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors > appium.log &
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: 3.12
- run: |
# Separate 'run' creates differnet pipenv env. Does them in one run for now.
pip install --upgrade pip
pip install --upgrade pipenv
pipenv lock --clear
pipenv install -d --system
pytest ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
- name: Save server output
if: ${{ always() }}
uses: actions/upload-artifact@master
with:
name: appium-ios-${{matrix.test_targets.name}}.log
path: appium.log
android_test:
strategy:
fail-fast: false
matrix:
test_targets:
- target: test/functional/android/appium_service_tests.py test/functional/android/chrome_tests.py
name: func_test_android1
runs-on: ubuntu-latest
env:
API_LEVEL: 29
ARCH: x86
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
# Start Appium
- run: npm install -g appium
- run: |
appium driver install uiautomator2
appium driver install espresso
appium plugin install execute-driver
nohup appium --use-plugins=execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
arch: ${{ env.ARCH }}
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
arch: ${{ env.ARCH }}
script: |
# Separate 'run' creates differnet pipenv env. Does them in one run for now.
pip install --upgrade pip
pip install --upgrade pipenv
pipenv lock --clear
pipenv install -d --system
pytest ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
target: google_apis
profile: Nexus 5X
disable-spellchecker: true
disable-animations: true
env:
ANDROID_SDK_VERSION: ${{ env.API_LEVEL }}
APPIUM_DRIVER: ${{matrix.test_targets.automation_name}}
IGNORE_VERSION_SKIP: true
CI: true
- name: Save server output
if: ${{ always() }}
uses: actions/upload-artifact@master
with:
name: appium-android-${{matrix.test_targets.name}}.log
path: appium.log
flutter_e2e_test:
# These flutter integration driver tests are maintained by: MummanaSubramanya
strategy:
fail-fast: false
matrix:
include:
- platform: macos-14
e2e-tests: flutter-ios
- platform: ubuntu-latest
e2e-tests: flutter-android
runs-on: ${{ matrix.platform }}
env:
API_LEVEL: 28
ARCH: x86
CI: true
XCODE_VERSION: 15.4
IOS_VERSION: 17.5
IPHONE_MODEL: iPhone 15
FLUTTER_ANDROID_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/app-debug.apk"
FLUTTER_IOS_APP: "https://github.com/AppiumTestDistribution/appium-flutter-server/releases/latest/download/ios.zip"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
if: matrix.e2e-tests == 'flutter-android'
with:
distribution: 'zulu'
java-version: '17'
- name: Enable KVM group perms
if: matrix.e2e-tests == 'flutter-android'
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install Appium
run: npm install --location=global appium
- name: Install Android drivers and Run Appium
if: matrix.e2e-tests == 'flutter-android'
run: |
appium driver install uiautomator2
appium driver install appium-flutter-integration-driver --source npm
nohup appium --allow-insecure=adb_shell --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium_flutter_android.log &
- name: Run Android tests
if: matrix.e2e-tests == 'flutter-android'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
script: |
pip install --upgrade pip
pip install --upgrade pipenv
pipenv lock --clear
pipenv install -d --system
export PLATFORM=android
pytest test/functional/flutter_integration/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
target: default
disable-spellchecker: true
disable-animations: true
- name: Save server output
if: always() && matrix.e2e-tests == 'flutter-android'
uses: actions/upload-artifact@master
with:
name: appium-flutter-android.log
path: appium_flutter_android.log
- name: Select Xcode
if: matrix.e2e-tests == 'flutter-ios'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- uses: futureware-tech/simulator-action@v3
if: matrix.e2e-tests == 'flutter-ios'
with:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
model: ${{ env.IPHONE_MODEL }}
os_version: ${{ env.IOS_VERSION }}
- name: install dependencies
if: matrix.e2e-tests == 'flutter-ios'
run: brew install ffmpeg
- name: Install IOS drivers and Run Appium
if: matrix.e2e-tests == 'flutter-ios'
run: |
appium driver install xcuitest
appium driver install appium-flutter-integration-driver --source npm
appium driver run xcuitest build-wda
nohup appium --allow-insecure=adb_shell --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium_ios.log &
- name: Run IOS tests
if: matrix.e2e-tests == 'flutter-ios'
run: |
# Separate 'run' creates differnet pipenv env. Does them in one run for now.
pip install --upgrade pip
pip install --upgrade pipenv
pipenv lock --clear
pipenv install -d --system
export PLATFORM=ios
pytest test/functional/flutter_integration/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html