Skip to content

e2e: Port the iOS-only tests for slow mode, truncation, scroll, read events, and attachments - #6572

Merged
andremion merged 6 commits into
developfrom
andrerego/and-1304-close-the-ios-e2e-parity-gap
Jul 15, 2026
Merged

e2e: Port the iOS-only tests for slow mode, truncation, scroll, read events, and attachments#6572
andremion merged 6 commits into
developfrom
andrerego/and-1304-close-the-ios-e2e-parity-gap

Conversation

@andremion

@andremion andremion commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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:

  • Slow mode (4 tests, ids 5788, 5790, 5791, 5794). The "message can't be sent" scenarios assert Android's own contract (cooldown indicator shown, composer disabled) because Android disables the composer during cooldown since Disable composer during slow mode #6499, while iOS keeps typing enabled. quoteMessage is split into selectReplyFromContextMenu plus 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.
  • Channel truncation (2 tests, ids 5797, 5827). iOS truncates through its test app's debug menu; the Android sample has none, so BackendRobot.truncateChannel triggers it server-side through a new mock-server route and the app reacts to the channel.truncated event. New assertMessageCount helper.
  • Message list scroll and commands (3 tests, ids 5795, 5831, 5720). Adds ParticipantRobot.sendMultipleMessages (mirrors iOS: text-index suffix, 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.
  • Read events and member removal (11 tests, ids 5746, 5756, 5759-5766, 5771). Adds BackendRobot.setReadEvents/addMember/removeMember (server-side member triggers in the mock server) and ParticipantRobot.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 ignore read_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 @Ignore and the tests are the acceptance check.
  • Attachment upload recovery (1 test, id 5928). iOS restarts a failed image upload with a dedicated button; the Compose SDK has no restart control, and the offline module uploads the image automatically on reconnect, so the test asserts that recovery under an Android-accurate name.

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:

./gradlew :stream-chat-android-compose-sample:connectedE2eDebugAndroidTest \
  -Pandroid.testInstrumentationRunnerArguments.class=io.getstream.chat.android.compose.tests.SlowModeTests

Same for ChannelListTests (truncation), MessageListTests (scroll and command), MessageDeliveryStatusTests (the 2 active read-events tests), and AttachmentsTests#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

  • Improvements
    • Added a UI selector/tag for the “scroll to bottom” unread-count badge, enabling more precise message list validations.
    • Improved end-to-end coverage for message list UI: composer attachment button state, scroll-to-bottom behavior, and reloading skipped messages.
    • Improved reliability testing for image upload recovery after connectivity returns.
    • Improved channel preview/message list correctness after truncation (with and without system messages).
    • Strengthened message delivery-status and preview indicators for participant changes and when read events are disabled.
    • Enhanced slow-mode end-to-end validation for replies, thread replies, context-menu actions, and message editing.
    • Improved composer command flow for Giphy suggestion selection.

@andremion andremion added the pr:ci CI changes label Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@andremion

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds 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.

Changes

Compose E2E coverage

Layer / File(s) Summary
Test selectors and robot helpers
stream-chat-android-compose/src/.../ScrollToBottomButton.kt, stream-chat-android-compose-sample/src/.../pages/MessageListPage.kt, stream-chat-android-compose-sample/src/.../robots/*
Adds the scroll-to-bottom unread-count test tag, matching selector and assertions, message-count and attachment-button assertions, plus reusable reply and Giphy command helpers.
Backend and participant controls
stream-chat-android-e2e-test/src/.../robots/BackendRobot.kt, ParticipantRobot.kt
Adds fluent APIs for channel truncation, read-event configuration, membership changes, participant identification, and sending numbered message batches.
Message list and attachment flows
stream-chat-android-compose-sample/src/.../tests/AttachmentsTests.kt, ChannelListTests.kt, MessageListTests.kt
Adds tests for offline image-upload recovery, truncated-channel presentation, Giphy command UI state, scroll-to-bottom behavior, and reloading skipped messages.
Delivery status coverage
stream-chat-android-compose-sample/src/.../tests/MessageDeliveryStatusTests.kt
Adds delivery-status tests for participant changes, read-event disabling, pending and failed messages, deletions, grouped messages, and channel previews.
Slow-mode interaction coverage
stream-chat-android-compose-sample/src/.../tests/SlowModeTests.kt
Adds tests for replies, context-menu actions, thread composers, editing, cooldown visibility, and quoted message content.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Suggested labels: pr:ci

Suggested reviewers: gpunto

Poem

I’m a rabbit with tests in my paws,
Checking messages, badges, and laws.
Offline then online,
Slow mode falls in line—
Green carrots for reliable draws! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: porting multiple iOS e2e test areas to the Android Compose sample.
Description check ✅ Passed The description includes Goal, Implementation, and Testing, and the missing visual/checklist sections are non-critical here.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch andrerego/and-1304-close-the-ios-e2e-parity-gap

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 value

Consider reusing assertVisibility.

Since assertVisibility is already defined in this file to handle boolean display assertions with the default timeout, you can reuse it here for the count == 0 disappearance 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8019222 and 43a287a.

📒 Files selected for processing (11)
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/pages/MessageListPage.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobot.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotMessageListAsserts.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/AttachmentsTests.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/ChannelListTests.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageDeliveryStatusTests.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageListTests.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/SlowModeTests.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/ScrollToBottomButton.kt
  • stream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/BackendRobot.kt
  • stream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/ParticipantRobot.kt

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.95 MB 5.95 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.21 MB 11.21 MB 0.00 MB 🟢
stream-chat-android-compose 12.69 MB 12.69 MB 0.00 MB 🟢

@andremion

Copy link
Copy Markdown
Contributor Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@andremion
andremion force-pushed the andrerego/and-1304-close-the-ios-e2e-parity-gap branch from ce13646 to 6b5b61b Compare July 15, 2026 08:28
@sonarqubecloud

Copy link
Copy Markdown

@andremion
andremion marked this pull request as ready for review July 15, 2026 08:56
@andremion
andremion requested a review from a team as a code owner July 15, 2026 08:56
@andremion
andremion merged commit 4338a8e into develop Jul 15, 2026
20 checks passed
@andremion
andremion deleted the andrerego/and-1304-close-the-ios-e2e-parity-gap branch July 15, 2026 09:22
@stream-public-bot stream-public-bot added the released Included in a release label Jul 30, 2026
@stream-public-bot

Copy link
Copy Markdown
Contributor

🚀 Available in v7.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:test Test-only changes released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants