Skip to content

Commit 5b867fb

Browse files
romtsnclaude
andcommitted
fix(test): Reset shade state between retries and recreate notification channel
Two issues found from analyzing the accessibility hierarchy dump: 1. Repeated swipe-downs accumulated into full quick settings expansion, hiding the notification list. Fix: press home before each swipe retry to reset the shade state, so each attempt opens a fresh notification shade instead of expanding quick settings further. 2. adb install -r preserves app data including notification channels. The old IMPORTANCE_DEFAULT channel persists and Android ignores the code change to IMPORTANCE_HIGH. Fix: delete the channel before recreating it to ensure correct importance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2ceb4d3 commit 5b867fb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ name: App Start Tests
3737
while:
3838
notVisible: "Sentry Test Notification"
3939
commands:
40-
# Short swipe to open notification shade without expanding to quick settings
40+
# Reset to home screen first to prevent swipes from accumulating
41+
# into quick settings expansion
42+
- pressKey: home
4143
- swipe:
4244
start: 50%, 0%
43-
end: 50%, 25%
45+
end: 50%, 40%
4446
duration: 500
4547
- waitForAnimationToEnd
4648
- tapOn: "Sentry Test Notification"
@@ -68,10 +70,12 @@ name: App Start Tests
6870
while:
6971
notVisible: "Sentry Test Notification"
7072
commands:
71-
# Short swipe to open notification shade without expanding to quick settings
73+
# Reset to home screen first to prevent swipes from accumulating
74+
# into quick settings expansion
75+
- pressKey: home
7276
- swipe:
7377
start: 50%, 0%
74-
end: 50%, 25%
78+
end: 50%, 40%
7579
duration: 500
7680
- waitForAnimationToEnd
7781
- tapOn: "Sentry Test Notification"

sentry-android-integration-tests/sentry-uitest-android-critical/src/main/java/io/sentry/uitest/android/critical/NotificationHelper.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ object NotificationHelper {
1919
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
2020

2121
// Create notification channel for Android 8.0+ (API 26+)
22+
// Delete first to ensure the channel is recreated with the correct importance,
23+
// since Android preserves channel settings across app reinstalls (adb install -r).
2224
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
25+
notificationManager.deleteNotificationChannel(CHANNEL_ID)
2326
val channel =
2427
NotificationChannel(CHANNEL_ID, "Notifications", NotificationManager.IMPORTANCE_HIGH)
2528
channel.description = "description"

0 commit comments

Comments
 (0)