-
Notifications
You must be signed in to change notification settings - Fork 273
197 lines (162 loc) · 5.23 KB
/
test-e2e.yaml
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
name: Test E2E
on:
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: macos-latest
if: github.repository == 'mobile-dev-inc/maestro'
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build xctest-runner
run: ./maestro-ios-xctest-runner/build-maestro-ios-runner.sh
- name: Build Maestro CLI
run: ./gradlew :maestro-cli:distZip
- uses: actions/upload-artifact@v4
with:
name: maestro-cli
path: maestro-cli/build/distributions/maestro.zip
retention-days: 1
test-local-android:
runs-on: ubuntu-latest
if: github.repository == 'mobile-dev-inc/maestro'
needs: build
env:
EMULATOR_API_LEVEL: 33
EMULATOR_TARGET: google_apis
EMULATOR_ARCH: x86_64
steps:
- 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: Clone repository (only needed for the e2e directory)
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: maestro-cli
- name: Add Maestro CLI executable to PATH
run: |
unzip maestro.zip -d maestro_extracted
echo "$PWD/maestro_extracted/maestro/bin" >> $GITHUB_PATH
- name: Check if Maestro CLI executable starts up
run: |
maestro --help
maestro --version
- name: Start emulator and run a Flow
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.EMULATOR_API_LEVEL }}
target: ${{ env.EMULATOR_TARGET }}
arch: ${{ env.EMULATOR_ARCH }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
working-directory: ${{ github.workspace }}/e2e
script: |
./download_apps
./install_apps
./run_tests
- name: Upload ~/.maestro artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: maestro-e2e-output
path: ~/.maestro
retention-days: 3
test-local-ios:
runs-on: macos-latest
if: github.repository == 'mobile-dev-inc/maestro'
needs: build
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 240000 # 240s
steps:
- name: Clone repository (only needed for the e2e directory)
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: maestro-cli
- name: Add Maestro CLI executable to PATH
run: |
unzip maestro.zip -d maestro_extracted
echo "$PWD/maestro_extracted/maestro/bin" >> $GITHUB_PATH
- name: Check if Maestro CLI executable starts up
run: |
maestro --help
maestro --version
- name: Start iOS simulator
uses: futureware-tech/simulator-action@v3
with:
model: iPhone 15
os: iOS
os_version: 17.5
erase_before_boot: true
shutdown_after_job: true
- name: Run a Flow
working-directory: ${{ github.workspace }}/e2e
run: |
./download_apps
./install_apps
./run_tests
test-cloud:
runs-on: ubuntu-latest
if: github.repository == 'mobile-dev-inc/maestro'
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: maestro-cli
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
- name: Add Maestro CLI executable to PATH
run: |
unzip maestro.zip -d maestro_extracted
echo "$PWD/maestro_extracted/maestro/bin" >> $GITHUB_PATH
- name: Check if Maestro CLI executable starts up
run: |
maestro --help
maestro --version
- name: maestro download-samples
run: maestro download-samples
- name: Run iOS test
run: |
maestro cloud \
--apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \
--timeout 180 \
--fail-on-cancellation \
--include-tags advanced \
samples/sample.zip \
samples
- name: Run Android test
run: |
maestro cloud \
--apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \
--fail-on-cancellation \
--include-tags advanced \
samples/sample.apk \
samples