Skip to content
Merged
12 changes: 7 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ jobs:
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH

- name: Enable KVM
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: Build, install, and run E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
script: >-
cd examples/hello-world &&
pn run android --no-logs &&
sleep 5 &&
cd ../.. &&
maestro test tests/e2e/android.yaml
bash -lc "cd examples/hello-world && pn run android --no-logs && cd ../.. && maestro test tests/e2e/android.yaml"

e2e-ios:
runs-on: macos-latest
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:
APP_ID: com.pythonnative.android_template
---
- runFlow: flows/main.yaml
- runFlow: flows/navigation.yaml
- runFlow: flows/layout_screen.yaml
- runFlow: flows/navigation_android.yaml
- runFlow: flows/layout_android.yaml
- runFlow: flows/list_screen.yaml
- runFlow: flows/settings_screen.yaml
17 changes: 17 additions & 0 deletions tests/e2e/flows/layout_android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
appId: ${APP_ID}
---
# Switch to the Layout screen and verify the parts that fit in the
# 320x640 Android CI viewport.
- launchApp
- extendedWaitUntil:
visible: "Hello from PythonNative Demo!"
timeout: 30000
- tapOn: "Layout"
- extendedWaitUntil:
visible: "Flex layout"
timeout: 10000
- assertVisible: "flex: 1"
- assertVisible: "Aspect ratio"
- assertVisible: "1:1"
- assertVisible: "16:9"
- assertVisible: "Absolute positioning"
23 changes: 23 additions & 0 deletions tests/e2e/flows/navigation_android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
appId: ${APP_ID}
---
# Navigate Home -> Showcase -> Forms and back on Android.
- launchApp
- extendedWaitUntil:
visible: "Hello from PythonNative Demo!"
timeout: 30000
- tapOn: "View Showcase"
- extendedWaitUntil:
visible: "Greetings from Home"
timeout: 10000
- scroll
- scroll
- extendedWaitUntil:
visible: "View Forms"
timeout: 10000
- tapOn: "View Forms"
- assertVisible: "Forms"
- assertVisible: "You navigated two levels deep."
- back
- extendedWaitUntil:
visible: "Greetings from Home"
timeout: 10000
Loading