Fix Maestro tests again (#6167)
* Increase the timeout for asserting 'Be in your element' is visible * Disable the chrome onboarding flow. This simplifies the code a lot and helps avoid corner cases. * More delays with timeout! * Add more info to the summary, specially when the tests fail, so we can quickly check what failed. * Make sure Maestro tests can't run in parallel, but APK builds can
This commit is contained in:
committed by
GitHub
parent
009adb9b88
commit
f5c250ed7a
24
.github/workflows/maestro-local.yml
vendored
24
.github/workflows/maestro-local.yml
vendored
@@ -18,9 +18,8 @@ jobs:
|
|||||||
build-apk:
|
build-apk:
|
||||||
name: Build APK
|
name: Build APK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Allow one per PR.
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ format('maestro-{0}', github.ref) }}
|
group: ${{ format('maestro-build-{0}', github.ref) }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
@@ -57,10 +56,10 @@ jobs:
|
|||||||
name: Maestro test suite
|
name: Maestro test suite
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build-apk ]
|
needs: [ build-apk ]
|
||||||
# Allow one per PR.
|
# Allow only one to run at a time, since they use the same environment.
|
||||||
|
# Otherwise, tests running in parallel can break each other.
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ format('maestro-{0}', github.ref) }}
|
group: maestro-test
|
||||||
cancel-in-progress: true
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
|
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
|
||||||
@@ -110,6 +109,21 @@ jobs:
|
|||||||
retention-days: 5
|
retention-days: 5
|
||||||
overwrite: true
|
overwrite: true
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
- name: Update summary (success)
|
||||||
|
if: steps.maestro_test.outcome == 'success'
|
||||||
|
run: |
|
||||||
|
echo "### Maestro tests worked :rocket:!"
|
||||||
|
- name: Update summary (failure)
|
||||||
|
if: steps.maestro_test.outcome != 'success'
|
||||||
|
run: |
|
||||||
|
LOG_FILE=$(find ~/.maestro/tests/ -name maestro.log)
|
||||||
|
echo "Log file: $LOG_FILE"
|
||||||
|
LOG_LINES="$(tail -n 30 $LOG_FILE)"
|
||||||
|
echo "### :x: Maestro tests failed...
|
||||||
|
|
||||||
|
\`\`\`
|
||||||
|
$LOG_LINES
|
||||||
|
\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||||
- name: Fail the workflow in case of error in test
|
- name: Fail the workflow in case of error in test
|
||||||
if: steps.maestro_test.outcome != 'success'
|
if: steps.maestro_test.outcome != 'success'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -8,6 +8,13 @@
|
|||||||
# Please see LICENSE in the repository root for full details.
|
# Please see LICENSE in the repository root for full details.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# First we disable the onboarding flow on Chrome, which is a source of issues
|
||||||
|
# (see https://stackoverflow.com/a/64629745)
|
||||||
|
echo "Disabling Chrome onboarding flow"
|
||||||
|
adb shell am set-debug-app --persistent com.android.chrome
|
||||||
|
adb shell 'echo "chrome --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line'
|
||||||
|
adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
|
||||||
|
|
||||||
adb install -r $1
|
adb install -r $1
|
||||||
echo "Starting the screen recording..."
|
echo "Starting the screen recording..."
|
||||||
adb push .github/workflows/scripts/maestro/local-recording.sh /data/local/tmp/
|
adb push .github/workflows/scripts/maestro/local-recording.sh /data/local/tmp/
|
||||||
|
|||||||
@@ -8,27 +8,6 @@ appId: ${MAESTRO_APP_ID}
|
|||||||
- tapOn:
|
- tapOn:
|
||||||
id: "login-continue"
|
id: "login-continue"
|
||||||
## MAS page
|
## MAS page
|
||||||
## Conditional workflow to pass the Chrome first launch welcome page.
|
|
||||||
- retry:
|
|
||||||
maxRetries: 3
|
|
||||||
commands:
|
|
||||||
- runFlow:
|
|
||||||
when:
|
|
||||||
visible: 'Use without an account'
|
|
||||||
commands:
|
|
||||||
- tapOn: "Use without an account"
|
|
||||||
## For older chrome versions
|
|
||||||
- runFlow:
|
|
||||||
when:
|
|
||||||
visible: 'Accept & continue'
|
|
||||||
commands:
|
|
||||||
- tapOn: "Accept & continue"
|
|
||||||
- runFlow:
|
|
||||||
when:
|
|
||||||
visible: 'No thanks'
|
|
||||||
commands:
|
|
||||||
- tapOn: "No thanks"
|
|
||||||
## Working when running Maestro locally, but not on the CI yet.
|
|
||||||
- retry:
|
- retry:
|
||||||
maxRetries: 3
|
maxRetries: 3
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
appId: ${MAESTRO_APP_ID}
|
appId: ${MAESTRO_APP_ID}
|
||||||
---
|
---
|
||||||
|
- extendedWaitUntil:
|
||||||
|
visible: "Enter recovery key"
|
||||||
|
timeout: 30000
|
||||||
- takeScreenshot: build/maestro/150-Verify
|
- takeScreenshot: build/maestro/150-Verify
|
||||||
- tapOn: "Enter recovery key"
|
- tapOn: "Enter recovery key"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
@@ -7,7 +10,10 @@ appId: ${MAESTRO_APP_ID}
|
|||||||
- inputText: ${MAESTRO_RECOVERY_KEY}
|
- inputText: ${MAESTRO_RECOVERY_KEY}
|
||||||
- hideKeyboard
|
- hideKeyboard
|
||||||
- tapOn: "Continue"
|
- tapOn: "Continue"
|
||||||
- extendedWaitUntil:
|
- retry:
|
||||||
visible: "Device verified"
|
maxRetries: 3
|
||||||
timeout: 30000
|
commands:
|
||||||
|
- extendedWaitUntil:
|
||||||
|
visible: "Device verified"
|
||||||
|
timeout: 30000
|
||||||
- tapOn: "Continue"
|
- tapOn: "Continue"
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ appId: ${MAESTRO_APP_ID}
|
|||||||
---
|
---
|
||||||
- extendedWaitUntil:
|
- extendedWaitUntil:
|
||||||
visible: "Be in your element"
|
visible: "Be in your element"
|
||||||
timeout: 10000
|
timeout: 30000
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ appId: ${MAESTRO_APP_ID}
|
|||||||
---
|
---
|
||||||
- extendedWaitUntil:
|
- extendedWaitUntil:
|
||||||
visible: "Confirm your identity"
|
visible: "Confirm your identity"
|
||||||
timeout: 20000
|
timeout: 60000
|
||||||
|
|||||||
Reference in New Issue
Block a user