Skip to content

Commit a5b4cde

Browse files
romtsnclaude
andcommitted
fix(test): Handle permission dialog and clean up notification shade
Three fixes for flaky notification tests on CI emulators: 1. Handle the POST_NOTIFICATIONS permission dialog explicitly in the Maestro flow, in case Maestro's `permissions: all: allow` doesn't grant it reliably. 2. Collapse the notification shade in onFlowStart to prevent cascade failures when a previous test left it open. 3. Add waitForAnimationToEnd inside the swipe retry loop to give the shade time to render. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f9faaf5 commit a5b4cde

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ platform:
22
android:
33
disableAnimations: true
44
onFlowStart:
5+
# Dismiss any ANR dialog (e.g. "Pixel Launcher isn't responding")
56
- runFlow:
67
when:
78
visible: "Close app"
89
commands:
910
- tapOn: "Close app"
11+
# Collapse notification shade if left open from a previous test
12+
- swipe:
13+
start: 50%, 50%
14+
end: 50%, 1%
15+
duration: 300
16+
- pressKey: home

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ name: App Start Tests
2323
all: allow
2424
- assertVisible: "Welcome!"
2525
- tapOn: "Trigger Notification"
26+
# Grant notification permission if the system dialog appears
27+
- runFlow:
28+
when:
29+
visible: "Allow"
30+
commands:
31+
- tapOn: "Allow"
2632
- tapOn: "Finish Activity"
2733
- assertNotVisible: "Welcome!"
2834
- waitForAnimationToEnd
@@ -35,6 +41,7 @@ name: App Start Tests
3541
start: 50%, 1%
3642
end: 50%, 50%
3743
duration: 1000
44+
- waitForAnimationToEnd
3845
- tapOn: "Sentry Test Notification"
3946
- assertVisible: "App Start Type: WARM"
4047

@@ -45,6 +52,12 @@ name: App Start Tests
4552
all: allow
4653
- assertVisible: "Welcome!"
4754
- tapOn: "Trigger Notification"
55+
# Grant notification permission if the system dialog appears
56+
- runFlow:
57+
when:
58+
visible: "Allow"
59+
commands:
60+
- tapOn: "Allow"
4861
- tapOn: "Finish Activity"
4962
- assertNotVisible: "Welcome!"
5063
- killApp
@@ -58,6 +71,7 @@ name: App Start Tests
5871
start: 50%, 1%
5972
end: 50%, 50%
6073
duration: 1000
74+
- waitForAnimationToEnd
6175
- tapOn: "Sentry Test Notification"
6276
- assertVisible: "App Start Type: COLD"
6377
# Test 5: Launch app after a broadcast receiver already created the application

0 commit comments

Comments
 (0)