-
Notifications
You must be signed in to change notification settings - Fork 4
361 lines (310 loc) · 12.6 KB
/
Copy pathios-appium-tests.yml
File metadata and controls
361 lines (310 loc) · 12.6 KB
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
name: iOS Appium Tests
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
inputs:
ios_version:
description: 'iOS Version'
required: false
default: '17.5'
device_name:
description: 'Device Name'
required: false
default: 'iPhone 15 Pro'
appium2_driver_version:
description: 'Appium 2 axe-devtools driver version (e.g. 2.2.0-beta.abc123)'
required: false
default: '2.2.0-beta.f652cff'
appium3_driver_version:
description: 'Appium 3 axe-devtools driver version (e.g. 1.1.0-beta.abc123)'
required: false
default: '1.1.0-beta.f652cff'
env:
XCODE_VERSION: '15.4'
IOS_VERSION: ${{ github.event.inputs.ios_version || '17.5' }}
DEVICE_NAME: ${{ github.event.inputs.device_name || 'iPhone 15 Pro' }}
APPIUM_SKIP_CHROMEDRIVER_INSTALL: 1
ADT_APIKEY: ${{ secrets.AXE_APIKEY }}
AGORA_NPM_EMAIL: ${{ secrets.AGORA_NPM_EMAIL }}
AGORA_NPM_AUTH: ${{ secrets.DQ_AGORA_IDENTITY_TOKEN }}
AGORA_REGISTRY_URL: //agora.dequecloud.com/artifactory/api/npm/axe-devtools-mobile-appium-qa/
jobs:
build-app:
name: Build iOS App
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
continue-on-error: true
- name: Fallback Xcode selection
if: failure()
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Show Xcode version
run: xcodebuild -version
- name: List available simulators
run: xcrun simctl list devices available
- name: Create build directory
run: mkdir -p build
- name: Build app for simulator
run: |
xcodebuild \
-project axe-devtools-ios-sample-app.xcodeproj \
-scheme axe-devtools-ios-sample-app \
-sdk iphonesimulator \
-configuration Release \
-derivedDataPath ./DerivedData \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
build
- name: Locate and copy built app
run: |
echo "Searching for built app..."
find ./DerivedData -name "*.app" -type d
echo "Copying app to build directory..."
cp -R ./DerivedData/Build/Products/Release-iphonesimulator/axe-devtools-ios-sample-app.app ./build/
- name: Verify app structure
run: |
ls -la ./build/axe-devtools-ios-sample-app.app
file ./build/axe-devtools-ios-sample-app.app/axe-devtools-ios-sample-app
- name: Upload app artifact
uses: actions/upload-artifact@v4
with:
name: ios-app
path: build/axe-devtools-ios-sample-app.app
retention-days: 1
test-appium-2:
name: Test with Appium 2
runs-on: macos-14
needs: build-app
strategy:
matrix:
xcuitest-driver-version: ['2.2.0-beta.f652cff']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
cache-dependency-path: ./appium-tests/package.json
- name: Download app artifact
uses: actions/download-artifact@v4
with:
name: ios-app
path: build/Release-iphonesimulator/axe-devtools-ios-sample-app.app
- name: Verify downloaded app
run: |
echo "Checking downloaded app structure..."
ls -la build/Release-iphonesimulator/
ls -la build/Release-iphonesimulator/axe-devtools-ios-sample-app.app/
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
continue-on-error: true
- name: Fallback Xcode selection
if: failure()
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Install Appium 2.x
run: |
npm install -g appium@2
appium --version
- name: Configure npm for @axe-devtools registry
run: |
echo "Configuring npm for @axe-devtools driver..."
git config user.name "deque-mobileteam"
git config user.email "mobileteam@deque.com"
npm config set "@deque:registry" "https:${{ env.AGORA_REGISTRY_URL }}"
npm config set "@axe-devtools:registry" "https:${{ env.AGORA_REGISTRY_URL }}"
npm config set "${{ env.AGORA_REGISTRY_URL }}:email" "${{ env.AGORA_NPM_EMAIL }}"
npm config set "${{ env.AGORA_REGISTRY_URL }}:_authToken" "${{ env.AGORA_NPM_AUTH }}"
- name: Install @axe-devtools XCUITest Driver
run: |
DRIVER_VERSION="${{ github.event.inputs.appium2_driver_version || matrix.xcuitest-driver-version }}"
echo "Installing @axe-devtools/axe-appium-xcuitest-driver@${DRIVER_VERSION}"
appium driver install --source=npm @axe-devtools/axe-appium-xcuitest-driver@${DRIVER_VERSION}
echo "Verifying driver installation..."
appium driver list
echo "Checking for AxeXCUITest driver..."
appium driver list | grep -i "axexcuitest" || echo "Warning: AxeXCUITest driver not found in list"
- name: Prepare and boot iOS simulator
id: prepareSimulator
uses: futureware-tech/simulator-action@v4
with:
model: "${{ env.DEVICE_NAME }}"
os_version: "${{ env.IOS_VERSION }}"
shutdown_after_job: true
- name: Wait for Simulator to finish booting
run: |
echo "Waiting for simulator ${{ steps.prepareSimulator.outputs.udid }} to boot..."
xcrun simctl bootstatus ${{ steps.prepareSimulator.outputs.udid }} -b
echo "✓ Simulator is fully booted"
- name: Verify simulator is ready
run: |
xcrun simctl list devices | grep "${{ steps.prepareSimulator.outputs.udid }}"
- name: Install dependencies
working-directory: appium-tests
run: npm ci
- name: Create screenshots directory
working-directory: appium-tests
run: mkdir -p screenshots
- name: Run Appium 2 tests
working-directory: appium-tests
env:
APP_PATH: ${{ github.workspace }}/build/Release-iphonesimulator/axe-devtools-ios-sample-app.app
IOS_VERSION: ${{ env.IOS_VERSION }}
DEVICE_NAME: ${{ env.DEVICE_NAME }}
run: npm run test:appium2
continue-on-error: true
- name: Display Appium logs
if: always()
working-directory: appium-tests
run: |
echo "========== Appium Server Logs =========="
cat appium.log 2>/dev/null || echo "No Appium logs found"
- name: Upload test results and logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-appium2-driver-${{ matrix.xcuitest-driver-version }}
path: |
appium-tests/screenshots/
appium-tests/appium.log
retention-days: 7
test-appium-3:
name: Test with Appium 3
runs-on: macos-14
needs: build-app
strategy:
matrix:
xcuitest-driver-version: ['1.1.0-beta.f652cff']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
cache-dependency-path: ./appium-tests/package.json
- name: Download app artifact
uses: actions/download-artifact@v4
with:
name: ios-app
path: build/Release-iphonesimulator/axe-devtools-ios-sample-app.app
- name: Verify downloaded app
run: |
echo "Checking downloaded app structure..."
ls -la build/Release-iphonesimulator/
ls -la build/Release-iphonesimulator/axe-devtools-ios-sample-app.app/
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
continue-on-error: true
- name: Fallback Xcode selection
if: failure()
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Install Appium 3.x
run: |
npm install -g appium@next
appium --version
- name: Configure npm for @axe-devtools registry
run: |
echo "Configuring npm for @axe-devtools driver..."
git config user.name "deque-mobileteam"
git config user.email "mobileteam@deque.com"
npm config set "@deque:registry" "https:${{ env.AGORA_REGISTRY_URL }}"
npm config set "@axe-devtools:registry" "https:${{ env.AGORA_REGISTRY_URL }}"
npm config set "${{ env.AGORA_REGISTRY_URL }}:email" "${{ env.AGORA_NPM_EMAIL }}"
npm config set "${{ env.AGORA_REGISTRY_URL }}:_authToken" "${{ env.AGORA_NPM_AUTH }}"
- name: Install @axe-devtools XCUITest Driver
run: |
DRIVER_VERSION="${{ github.event.inputs.appium3_driver_version || matrix.xcuitest-driver-version }}"
echo "Installing @axe-devtools/axe-appium3-xcuitest-driver@${DRIVER_VERSION}"
appium driver install --source=npm @axe-devtools/axe-appium3-xcuitest-driver@${DRIVER_VERSION}
echo "Verifying driver installation..."
appium driver list
echo "Checking for AxeXCUITest driver..."
appium driver list | grep -i "axexcuitest" || echo "Warning: AxeXCUITest driver not found in list"
- name: Prepare and boot iOS simulator
id: prepareSimulator
uses: futureware-tech/simulator-action@v4
with:
model: "${{ env.DEVICE_NAME }}"
os_version: "${{ env.IOS_VERSION }}"
shutdown_after_job: true
- name: Wait for Simulator to finish booting
run: |
echo "Waiting for simulator ${{ steps.prepareSimulator.outputs.udid }} to boot..."
xcrun simctl bootstatus ${{ steps.prepareSimulator.outputs.udid }} -b
echo "✓ Simulator is fully booted"
- name: Verify simulator is ready
run: |
xcrun simctl list devices | grep "${{ steps.prepareSimulator.outputs.udid }}"
- name: Install dependencies
working-directory: appium-tests
run: npm ci
- name: Create screenshots directory
working-directory: appium-tests
run: mkdir -p screenshots
- name: Run Appium 3 tests
working-directory: appium-tests
env:
APP_PATH: ${{ github.workspace }}/build/Release-iphonesimulator/axe-devtools-ios-sample-app.app
IOS_VERSION: ${{ env.IOS_VERSION }}
DEVICE_NAME: ${{ env.DEVICE_NAME }}
run: npm run test:appium3
continue-on-error: true
- name: Display Appium logs
if: always()
working-directory: appium-tests
run: |
echo "========== Appium Server Logs =========="
cat appium.log 2>/dev/null || echo "No Appium logs found"
- name: Upload test results and logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-appium3-driver-${{ matrix.xcuitest-driver-version }}
path: |
appium-tests/screenshots/
appium-tests/appium.log
retention-days: 7
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test-appium-2, test-appium-3]
if: always()
steps:
- name: Summary
run: |
echo "## Test Execution Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Build completed" >> $GITHUB_STEP_SUMMARY
echo "📱 Device: ${{ env.DEVICE_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "📱 iOS Version: ${{ env.IOS_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "🔧 Using @axe-devtools custom drivers" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Appium Versions Tested:" >> $GITHUB_STEP_SUMMARY
echo "- Appium 2.x with @axe-devtools driver version: 2.2.0-beta.f652cff" >> $GITHUB_STEP_SUMMARY
echo "- Appium 3.x with @axe-devtools driver version: 1.1.0-beta.f652cff" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Check the artifacts for detailed test results and screenshots." >> $GITHUB_STEP_SUMMARY