Ensure the CI is marked as failed when Maestro test is failing (#4700)

* Ensure the CI is marked as failed when Maestro test is failing

* Fix typo in String to disable bookmark in ChromeCustomTab

* Fix Maestro test now that matrix.org is using MAS to authenticate.

* Fix Maestro test - other issues due to recent changes.

* Maestro: add test on Element Call

* Run through Chrome on boarding step.

* Try suggestion from https://github.com/mobile-dev-inc/Maestro/issues/1126#issuecomment-2842220361

* Revert "Try suggestion from https://github.com/mobile-dev-inc/Maestro/issues/1126#issuecomment-2842220361"

This reverts commit d400644622c1a240deb61040f9095e3221e07f21.

* Add comment on Maestro flow.
This commit is contained in:
Benoit Marty 2025-05-15 17:14:41 +02:00 committed by GitHub
parent f1ca70fb9a
commit 38ad415ab5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 36 additions and 13 deletions

View file

@ -56,7 +56,7 @@ jobs:
maestro-cloud:
name: Maestro test suite
runs-on: ubuntu-latest
needs: [build-apk]
needs: [ build-apk ]
# Allow one per PR.
concurrency:
group: ${{ format('maestro-{0}', github.ref) }}
@ -80,6 +80,7 @@ jobs:
- name: Install maestro
run: curl -fsSL "https://get.maestro.mobile.dev" | bash
- name: Run Maestro tests in emulator
id: maestro_test
uses: reactivecircus/android-emulator-runner@v2
continue-on-error: true
env:
@ -109,3 +110,8 @@ jobs:
retention-days: 5
overwrite: true
if-no-files-found: error
- name: Fail the workflow in case of error in test
if: steps.maestro_test.outcome != 'success'
run: |
echo "Maestro tests failed. Please check the logs."
exit 1

View file

@ -7,22 +7,24 @@ appId: ${MAESTRO_APP_ID}
- runFlow: ../assertions/assertLoginDisplayed.yaml
- tapOn:
id: "login-continue"
## MAS page
## Conditional workflow to pass the Chrome first launch welcome page.
- runFlow:
when:
visible: 'Use without an account'
commands:
- tapOn: "Use without an account"
## Working when running Maestro locally, but not on the CI yet.
- tapOn:
id: "login-email_username"
id: "form-1"
- inputText: ${MAESTRO_USERNAME}
- pressKey: Enter
- tapOn:
id: "login-password"
- inputText: "wrong-password"
- pressKey: Enter
- tapOn: "Continue"
- tapOn: "OK"
- tapOn:
id: "login-password"
- eraseText: 20
id: "form-3"
- inputText: ${MAESTRO_PASSWORD}
- pressKey: Enter
- tapOn: "Continue"
## Back to native world
- runFlow: ../assertions/assertSessionVerificationDisplayed.yaml
- runFlow: ./verifySession.yaml
- runFlow: ../assertions/assertAnalyticsDisplayed.yaml

View file

@ -8,6 +8,6 @@ appId: ${MAESTRO_APP_ID}
- hideKeyboard
- tapOn: "Continue"
- extendedWaitUntil:
visible: "Device verified"
visible: "Verification complete"
timeout: 30000
- tapOn: "Continue"

View file

@ -7,8 +7,9 @@ appId: ${MAESTRO_APP_ID}
- tapOn:
text: ${MAESTRO_INVITEE1_MXID}
index: 1
- tapOn: "Send invite"
- takeScreenshot: build/maestro/330-createAndDeleteDM
- tapOn: "maestroelement2"
- scroll
- tapOn: "Leave conversation"
- tapOn: "Leave room"
- tapOn: "Leave"

View file

@ -0,0 +1,13 @@
appId: ${MAESTRO_APP_ID}
---
- tapOn: "Start a call"
- takeScreenshot: build/maestro/700-Call
- extendedWaitUntil:
visible: "maestroelement"
timeout: 10000
- takeScreenshot: build/maestro/710-Call
# Hangup
- tapOn: "End call"
- extendedWaitUntil:
visible: "MyRoom"
timeout: 10000

View file

@ -6,5 +6,6 @@ appId: ${MAESTRO_APP_ID}
- runFlow: messages/text.yaml
- runFlow: messages/location.yaml
- runFlow: messages/poll.yaml
- runFlow: call/call.yaml
- back
- runFlow: ../../assertions/assertHomeDisplayed.yaml

View file

@ -53,7 +53,7 @@ fun Activity.openUrlInChromeCustomTab(
// Disable download button
intent.putExtra("org.chromium.chrome.browser.customtabs.EXTRA_DISABLE_DOWNLOAD_BUTTON", true)
// Disable bookmark button
intent.putExtra("org.chromium.chrome.browser.customtabs.EXTRA_DISABLE_START_BUTTON", true)
intent.putExtra("org.chromium.chrome.browser.customtabs.EXTRA_DISABLE_STAR_BUTTON", true)
intent.putExtra(Browser.EXTRA_HEADERS, Bundle().apply {
putString("Accept-Language", Locale.getDefault().toLanguageTag())
})