From 5f06c3918c4160ada8ae4bbc5625466306f39ab3 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 22 Oct 2026 13:38:54 +0200 Subject: [PATCH] ci: tap the ios push banner right after the push --- .maestro/push/01-notification.yaml | 36 ++++++++++++------------- .maestro/subflows/tap-banner.yaml | 8 ++++++ .maestro/subflows/tap-notification.yaml | 29 -------------------- 3 files changed, 26 insertions(+), 47 deletions(-) create mode 100644 .maestro/subflows/tap-banner.yaml delete mode 100644 .maestro/subflows/tap-notification.yaml diff --git a/.maestro/push/01-notification.yaml b/.maestro/push/01-notification.yaml index 740e7446..f6eb6dc1 100644 --- a/.maestro/push/01-notification.yaml +++ b/.maestro/push/01-notification.yaml @@ -35,41 +35,41 @@ tags: timeout: 3000 - pressKey: Home +# 1. The banner shows (and what it says). +- evalScript: ${output.subject0 = 'E2E push banner ' + Date.now()} +- runScript: + file: ../scripts/helper.js + env: + CALL: /simpush?to=${ACCOUNT}&subject=${encodeURIComponent(output.subject0)} +- extendedWaitUntil: + visible: ".*${output.subject0}.*|.*New message.*" + timeout: 30000 +- takeScreenshot: push-01-banner + +# 2. A tap opens the message, app in the background. The banner shows for a +# few seconds and finding it takes Maestro about as long; taps on the lock +# screen list do nothing on these simulators. So tap where the banner +# appears, right after the push. - evalScript: ${output.subject = 'E2E push ' + Date.now()} - runScript: file: ../scripts/helper.js env: CALL: /simpush?to=${ACCOUNT}&subject=${encodeURIComponent(output.subject)} -# The banner shows for a few seconds: catch it with either text, then check. -- extendedWaitUntil: - visible: ".*${output.subject}.*|.*New message.*" - timeout: 30000 -- takeScreenshot: push-01-banner -- runFlow: - file: ../subflows/tap-notification.yaml - env: - TEXT: ".*${output.subject}.*|.*New message.*" +- runFlow: ../subflows/tap-banner.yaml - extendedWaitUntil: visible: "Reply All" timeout: 60000 - assertVisible: ".*${output.subject}.*" - takeScreenshot: push-02-opened-warm -# Cold start: the app isn't running when the notification is tapped. +# 3. The same from a cold start: the app isn't running. - stopApp - evalScript: ${output.subject2 = 'E2E push cold ' + Date.now()} - runScript: file: ../scripts/helper.js env: CALL: /simpush?to=${ACCOUNT}&subject=${encodeURIComponent(output.subject2)} -- extendedWaitUntil: - visible: ".*${output.subject2}.*|.*New message.*" - timeout: 30000 -- takeScreenshot: push-03-banner-cold -- runFlow: - file: ../subflows/tap-notification.yaml - env: - TEXT: ".*${output.subject2}.*|.*New message.*" +- runFlow: ../subflows/tap-banner.yaml - extendedWaitUntil: visible: "Reply All" timeout: 90000 diff --git a/.maestro/subflows/tap-banner.yaml b/.maestro/subflows/tap-banner.yaml new file mode 100644 index 00000000..4ffbc83d --- /dev/null +++ b/.maestro/subflows/tap-banner.yaml @@ -0,0 +1,8 @@ +# Tap the notification banner at the top of the screen, at once (it shows +# for a few seconds only). +appId: org.bulwarkmail.mobile +--- +- tapOn: + point: "50%,9%" + waitToSettleTimeoutMs: 500 + retryTapIfNoChange: false diff --git a/.maestro/subflows/tap-notification.yaml b/.maestro/subflows/tap-notification.yaml deleted file mode 100644 index f9d56aad..00000000 --- a/.maestro/subflows/tap-notification.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Tap the notification matching TEXT in Notification Center. The banner -# goes away after a few seconds, often between Maestro finding it and -# tapping it (the tap then lands on whatever is below): wait until it is -# gone, pull Notification Center down from the top left, and tap there. -# A tap while the pull-down still moves does nothing, so tap until the -# notification is gone (the app opened). -appId: org.bulwarkmail.mobile ---- -- extendedWaitUntil: - notVisible: ${TEXT} - timeout: 15000 - optional: true -- swipe: - start: 20%,1% - end: 20%,60% - duration: 500 -- extendedWaitUntil: - visible: ${TEXT} - timeout: 10000 -- waitForAnimationToEnd: - timeout: 3000 -- repeat: - while: - visible: ${TEXT} - times: 3 - commands: - - tapOn: ${TEXT} - - waitForAnimationToEnd: - timeout: 4000