e2e: Port the iOS push notification tests#6574
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
WalkthroughAdds end-to-end push notification infrastructure and coverage for the Compose sample, including mock payload delivery, notification-shade assertions, notification deep-link navigation, and valid, degraded, and invalid payload scenarios. ChangesPush notification E2E flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ParticipantRobot
participant PushTestReceiver
participant FirebaseMessagingDelegate
participant NotificationShade
participant StartupActivity
participant ChannelActivity
ParticipantRobot->>PushTestReceiver: send mock push payload
PushTestReceiver->>FirebaseMessagingDelegate: handleRemoteMessage(RemoteMessage)
FirebaseMessagingDelegate->>NotificationShade: display push notification
NotificationShade->>StartupActivity: launch with channel and message extras
StartupActivity->>ChannelActivity: build and open channel navigation
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotPushAsserts.kt`:
- Around line 40-45: Update UserRobot.assertPushNotificationDoesNotAppear so the
negative assertion waits through the asynchronous notification-delivery window
before evaluating visibility. Use the framework’s full-duration wait mechanism,
such as By.text(text).waitDisplayed with the appropriate timeout, or an
equivalent explicit delay, and assert the notification remains absent before
pressing back and returning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fc93a9da-7a8e-4e5f-937b-fa6fa6824715
📒 Files selected for processing (7)
stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobot.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotPushAsserts.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/PushNotificationTests.ktstream-chat-android-compose-sample/src/e2e/AndroidManifest.xmlstream-chat-android-compose-sample/src/e2e/java/io/getstream/chat/android/compose/sample/push/PushTestReceiver.ktstream-chat-android-compose-sample/src/e2e/java/io/getstream/chat/android/compose/sample/ui/StartupActivity.ktstream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/ParticipantRobot.kt
SDK Size Comparison 📏
|
|
CI note: the red |
testableapple
left a comment
There was a problem hiding this comment.
LGTM, just make sure tests are green 👍
Sure. It will be when GetStream/stream-chat-test-mock-server#46 is merged 🙏🏻 |
1b61fdb to
716f71c
Compare
|



Goal
Port the iOS push notification e2e tests, the last topic of the iOS parity gap. Resolves AND-1311.
Push is the one feature that does not travel over the app's own connection, so it needs a delivery path the mock server can drive. The 7 tests bind to their pre-seeded Allure TestOps case ids via
@AllureId.Implementation
PushTestReceiver(e2e flavor): an exported broadcast receiver that turns the payload extras into aRemoteMessageand hands it toFirebaseMessagingDelegate.handleRemoteMessage, the same entry point a real FCM message uses. The payload then goes through the SDK's real validation and notification rendering, so the four degradation tests exercise the actualPayloadValidator. No Play services or root needed.StartupActivity(e2e flavor): a launch from a notification tap routes to the channel viaTaskStackBuilder, mirroring the demo flavor. Initialization is guarded on the presence of theBASE_URLextra, so a tap launch reuses the already initialized client instead of re-initializing and tearing down the live one.ParticipantRobot.sendPushNotificationposts to the mock endpoint with the receiver component;UserRobotgets notification-shade helpers;UserRobotPushAssertsasserts a notification is or is not shown.Requires GetStream/stream-chat-test-mock-server#46 for the Android delivery branch of
/participant/push; until it merges, these tests fail on CI.Not ported: iOS scenarios
goToBackgroundFrom*_and_tapOnPushNotificationno longer exist in the iOS suite, so this is 7 tests, not the 9 case ids originally seeded; the two orphan ids go on the TestOps cleanup list in AND-1301.Testing
All 7 pass locally as a suite against the mock server (PR #46 branch) on a Pixel 8 API 35 emulator, first attempt:
No UI changes to the SDK.
Summary by CodeRabbit
New Features
Bug Fixes