diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 00623a4..fd72f06 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/tests/e2e/android.yaml b/tests/e2e/android.yaml index 41c36bd..7f422cb 100644 --- a/tests/e2e/android.yaml +++ b/tests/e2e/android.yaml @@ -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 diff --git a/tests/e2e/flows/layout_android.yaml b/tests/e2e/flows/layout_android.yaml new file mode 100644 index 0000000..652f88f --- /dev/null +++ b/tests/e2e/flows/layout_android.yaml @@ -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" diff --git a/tests/e2e/flows/navigation_android.yaml b/tests/e2e/flows/navigation_android.yaml new file mode 100644 index 0000000..60aba95 --- /dev/null +++ b/tests/e2e/flows/navigation_android.yaml @@ -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