Skip to content

Commit cd5740b

Browse files
romtsnclaude
andcommitted
fix(test): Move notification tap inside retry loop to avoid race condition
The notification shade was closing between the repeat loop's visibility check and the subsequent tapOn command. By moving the tapOn inside the loop (with optional: true) and changing the loop condition to check for the app's expected screen instead, we tap the notification immediately after the swipe while the shade is still open. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ed4773b commit cd5740b

File tree

1 file changed

+10
-4
lines changed
  • sentry-android-integration-tests/sentry-uitest-android-critical/maestro

1 file changed

+10
-4
lines changed

sentry-android-integration-tests/sentry-uitest-android-critical/maestro/appStart.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ name: App Start Tests
3535
- repeat:
3636
times: 5
3737
while:
38-
notVisible: "Sentry Test Notification"
38+
notVisible: "App Start Type: WARM"
3939
commands:
4040
# Reset to home screen to collapse any open shade/quick settings
4141
- pressKey: back
@@ -46,7 +46,10 @@ name: App Start Tests
4646
start: 90%, 0%
4747
end: 90%, 50%
4848
duration: 2000
49-
- tapOn: "Sentry Test Notification"
49+
# Tap immediately after swipe while shade is still open
50+
- tapOn:
51+
text: "Sentry Test Notification"
52+
optional: true
5053
- assertVisible: "App Start Type: WARM"
5154

5255
# Test 4: Notification (COLD start)
@@ -69,7 +72,7 @@ name: App Start Tests
6972
- repeat:
7073
times: 5
7174
while:
72-
notVisible: "Sentry Test Notification"
75+
notVisible: "App Start Type: COLD"
7376
commands:
7477
# Reset to home screen to collapse any open shade/quick settings
7578
- pressKey: back
@@ -80,7 +83,10 @@ name: App Start Tests
8083
start: 90%, 0%
8184
end: 90%, 50%
8285
duration: 2000
83-
- tapOn: "Sentry Test Notification"
86+
# Tap immediately after swipe while shade is still open
87+
- tapOn:
88+
text: "Sentry Test Notification"
89+
optional: true
8490
- assertVisible: "App Start Type: COLD"
8591
# Test 5: Launch app after a broadcast receiver already created the application
8692
# Uncomment once https://github.com/mobile-dev-inc/Maestro/pull/2925 is merged

0 commit comments

Comments
 (0)