Skip to content

Commit 2488faf

Browse files
authored
ci(workflows,tests): stabilize Android E2E on CI (#4)
1 parent 1ed580a commit 2488faf

4 files changed

Lines changed: 49 additions & 7 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ jobs:
3535
curl -Ls "https://get.maestro.mobile.dev" | bash
3636
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
3737
38+
- name: Enable KVM
39+
run: |
40+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
41+
sudo udevadm control --reload-rules
42+
sudo udevadm trigger --name-match=kvm
43+
3844
- name: Build, install, and run E2E tests
3945
uses: reactivecircus/android-emulator-runner@v2
4046
with:
4147
api-level: 31
4248
arch: x86_64
4349
script: >-
44-
cd examples/hello-world &&
45-
pn run android --no-logs &&
46-
sleep 5 &&
47-
cd ../.. &&
48-
maestro test tests/e2e/android.yaml
50+
bash -lc "cd examples/hello-world && pn run android --no-logs && cd ../.. && maestro test tests/e2e/android.yaml"
4951
5052
e2e-ios:
5153
runs-on: macos-latest

tests/e2e/android.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ env:
33
APP_ID: com.pythonnative.android_template
44
---
55
- runFlow: flows/main.yaml
6-
- runFlow: flows/navigation.yaml
7-
- runFlow: flows/layout_screen.yaml
6+
- runFlow: flows/navigation_android.yaml
7+
- runFlow: flows/layout_android.yaml
88
- runFlow: flows/list_screen.yaml
99
- runFlow: flows/settings_screen.yaml
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
appId: ${APP_ID}
2+
---
3+
# Switch to the Layout screen and verify the parts that fit in the
4+
# 320x640 Android CI viewport.
5+
- launchApp
6+
- extendedWaitUntil:
7+
visible: "Hello from PythonNative Demo!"
8+
timeout: 30000
9+
- tapOn: "Layout"
10+
- extendedWaitUntil:
11+
visible: "Flex layout"
12+
timeout: 10000
13+
- assertVisible: "flex: 1"
14+
- assertVisible: "Aspect ratio"
15+
- assertVisible: "1:1"
16+
- assertVisible: "16:9"
17+
- assertVisible: "Absolute positioning"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
appId: ${APP_ID}
2+
---
3+
# Navigate Home -> Showcase -> Forms and back on Android.
4+
- launchApp
5+
- extendedWaitUntil:
6+
visible: "Hello from PythonNative Demo!"
7+
timeout: 30000
8+
- tapOn: "View Showcase"
9+
- extendedWaitUntil:
10+
visible: "Greetings from Home"
11+
timeout: 10000
12+
- scroll
13+
- scroll
14+
- extendedWaitUntil:
15+
visible: "View Forms"
16+
timeout: 10000
17+
- tapOn: "View Forms"
18+
- assertVisible: "Forms"
19+
- assertVisible: "You navigated two levels deep."
20+
- back
21+
- extendedWaitUntil:
22+
visible: "Greetings from Home"
23+
timeout: 10000

0 commit comments

Comments
 (0)