e2e: Port the iOS-only tests for slow mode, truncation, scroll, read events, and attachments - #6572
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
WalkthroughAdds Compose UI test selectors and robot helpers, backend controls, and end-to-end tests covering attachment recovery, channel truncation, message-list scrolling, delivery statuses, and slow-mode interactions. ChangesCompose E2E coverage
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 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.
🧹 Nitpick comments (1)
stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotMessageListAsserts.kt (1)
274-282: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider reusing
assertVisibility.Since
assertVisibilityis already defined in this file to handle boolean display assertions with the default timeout, you can reuse it here for thecount == 0disappearance check.♻️ Proposed refactor
- } else { - assertFalse(badge.waitToDisappear().isDisplayed()) - } + } else { + assertVisibility(badge, isDisplayed = false) + }🤖 Prompt for 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. In `@stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotMessageListAsserts.kt` around lines 274 - 282, Update UserRobot.assertScrollToBottomButtonUnreadCount to reuse the existing assertVisibility helper for the count == 0 case, passing the badge and expected invisible state, while preserving the current text assertion for positive counts and fluent return.
🤖 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.
Nitpick comments:
In
`@stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotMessageListAsserts.kt`:
- Around line 274-282: Update UserRobot.assertScrollToBottomButtonUnreadCount to
reuse the existing assertVisibility helper for the count == 0 case, passing the
badge and expected invisible state, while preserving the current text assertion
for positive counts and fluent return.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 842e181c-39ff-40fb-9a61-32612b26d538
📒 Files selected for processing (11)
stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/pages/MessageListPage.ktstream-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/UserRobotMessageListAsserts.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/AttachmentsTests.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/ChannelListTests.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageDeliveryStatusTests.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageListTests.ktstream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/SlowModeTests.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/ScrollToBottomButton.ktstream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/BackendRobot.ktstream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/ParticipantRobot.kt
SDK Size Comparison 📏
|
|
@CodeRabbit full review |
✅ Action performedFull review finished. |
ce13646 to
6b5b61b
Compare
|
|
🚀 Available in v7.7.0 |



Goal
Close the iOS e2e parity gap for every topic that needs no new delivery infrastructure: slow mode, channel truncation, message list scroll, read events, and attachment upload recovery. Each ported test binds to its pre-seeded Allure TestOps case id via
@AllureId, so the case flips from manual to automated and keeps its history. Part of AND-1304; push notifications follow separately because they need a new delivery path in the mock server.Implementation
One commit per topic, in the order they were verified:
quoteMessageis split intoselectReplyFromContextMenuplus send, since two tests need the reply action alone. The cooldown duration is 60 seconds (iOS uses 15) so it cannot expire between the message send and the assert on a slow CI emulator; no test waits for the cooldown to end.BackendRobot.truncateChanneltriggers it server-side through a new mock-server route and the app reacts to thechannel.truncatedevent. NewassertMessageCounthelper.ParticipantRobot.sendMultipleMessages(mirrors iOS:text-indexsuffix, 300ms spacing), a testTag on the scroll-to-bottom unread badge plus its assert helper, and the zero-count backfill on the truncation tests. The command test asserts Android's behavior: the attachments button hides when a command is selected from the suggestions, while on iOS typing/already hides the left buttons.BackendRobot.setReadEvents/addMember/removeMember(server-side member triggers in the mock server) andParticipantRobot.id. Only 2 land active: the other 9 assert behavior the Compose SDK does not implement yet and are@Ignored against AND-1309 (delivery indicators ignoreread_events) and AND-1310 (READ does not fall back to SENT when the reading member is removed). Both tickets list their tests; the fix PRs remove the@Ignoreand the tests are the acceptance check.The truncation and member trigger routes this PR relies on shipped in GetStream/stream-chat-test-mock-server#44 (merged).
Not ported, with reasons verified per case: 5786, 5696, 5913, 5924, 5926 are already covered by existing active Android tests; 5829, 5708, 5929 no longer exist in the iOS suite; 5914 asserts "loaded but off-screen", which Compose's LazyColumn does not expose to UiAutomator (the observable behavior is covered by active test 5912). The full disposition list is on AND-1304.
Testing
All new active tests pass locally against the mock server, first attempt each:
Same for
ChannelListTests(truncation),MessageListTests(scroll and command),MessageDeliveryStatusTests(the 2 active read-events tests), andAttachmentsTests#test_imageUploadRecovers_whenUserComesBackOnline. The suite needs the attachment fixtures on the emulator (bundle exec fastlane upload_attachments) and recent modification times on them, so they appear in the picker's first screen.On CI, the full 6-API-level matrix ran from this branch against the new mock routes (run): the truncation and member trigger tests passed on every API level. The only failures were the two slow mode tests on the 3 slower API levels, which is what the 60-second cooldown commit fixes.
No UI changes (the only SDK change is a testTag).
Summary by CodeRabbit