Skip to content

ci(repo): Add E2E message list tests - #2854

Draft
testableapple wants to merge 11 commits into
masterfrom
ci/message-list-tests
Draft

ci(repo): Add E2E message list tests#2854
testableapple wants to merge 11 commits into
masterfrom
ci/message-list-tests

Conversation

@testableapple

@testableapple testableapple commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Linear: https://linear.app/stream/issue/FLU-603

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Ports the native MessageList_Tests.swift / MessageListTests.kt suite to the sample app's integration tests, plus the harness plumbing it needed. Second suite after #2825 (reactions).

New tests (integration_test/message_list_test.dart) — 27 total: 23 active, 4 skipped

  • Send — by user / by participant, one emoji, multiple emojis, receiving an emoji, multiline
  • Edit — by user through the UI, by participant through the mock server (incl. the Edited footnote)
  • Delete — by user through the UI, by participant, participant hard-delete
  • Typing indicators — in the channel and in a thread
  • Offline — participant message received while the user is offline
  • Threads — a participant's thread reply appears in the thread
  • Mentions — the overlay appears on @ and disappears when it's removed
  • Scrolling — auto-scrolls when a message arrives at the bottom, does not when scrolled up
  • Pagination — seeds 60 messages and scrolls up to the oldest
  • Link preview — participant-sent YouTube link
  • Geometry — message cell grows/shrinks when edited, composer stops growing at its line limit

Harness additions

  • pages/message_list_page.dart — action rows, list, composer overlays, back button, thread header. All selectors reuse identifiers the SDK already exposes; no test-only keys were added to the SDK.
  • support/widget_test_extensions.darttapFinder (ensureVisible + tap for below-fold modal rows), scrollMessageList(delta), scrollUpUntilVisible, plus a bounded settle() so a perpetual reconnect animation can't hang pumpAndSettle.
  • robots/user_robot.dart — edit / delete / openThread / typeText / clearComposer / tapBackButton / scroll, with chain mirrors; user_robot_message_list_asserts.dart gained edited / deleted / hardDeleted / typing / mentions / linkPreview / threadReply asserts plus pagination and the two getSize-based geometry asserts.
  • robots/participant_robot.dart — chain mirrors for editMessage / deleteMessage / sendMessageInThread / startTyping / stopTyping.
  • support/stream_test_env.dartmoveToBackground() / moveToForeground() lifecycle helpers.
  • lib/pages/thread_page.dart — the sample app's thread page now renders a StreamTypingIndicator(parentId:), which is what the thread-typing test asserts on.

CI: recover a simulator that dies mid-run

The first nightly run of this suite exposed an unrelated harness gap. On the iOS 17.5 leg (job 89985512388) the simulator itself died ~11 min in: 17 tests had passed, the 18th went silent mid-setup, the remaining tests were reported as instant passes with no output, and flutter test exited non-zero. Because prepare_simulator ran once before the attempt loop, every retry after that failed in ~15s with No supported devices found with name or id matching <udid> — and reactions_test.dart never ran a single test.

run_e2e_test now calls boot_simulator at the top of every attempt except the first: a no-op when the device is already booted, simctl bootstatus -b when it is shut down, and an early return when the udid is gone entirely (so a missing device can't block the run). One crashed simulator now costs one attempt instead of the rest of the job.

WIP

Test Why
user adds a message while offline Offline channel.sendMessage throws an unhandled async StreamChatNetworkError that the integration_test binding surfaces and that poisons the rest of the bundle.
user recovers a message received while in the background moveToForeground → client.maybeReconnect spins indefinitely under the in-process binding and hangs the run.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added a typing indicator overlay at the bottom of thread conversations.
  • Bug Fixes
    • Improved stability of message-list interactions (notably scrolling behavior).
  • Tests
    • Expanded end-to-end integration coverage for message behaviors (sending, editing, deleting, mentions, typing, pagination, and link previews) with richer assertions and robot helpers.
  • Chores
    • Updated simulator boot handling for reliable iOS test retries and adjusted iOS embedded frameworks.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 09daa578-cc87-4903-8105-b266dbb2633f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Message list integration testing

Layer / File(s) Summary
Deterministic integration-test harness
sample_app/integration_test/support/*, sample_app/pubspec.yaml, melos.yaml
Adds URL-launch mocking, lifecycle controls, bounded settling, scrolling utilities, and the URL launcher test dependency.
Message-list page and robot actions
sample_app/integration_test/pages/message_list_page.dart, sample_app/integration_test/robots/*
Adds selectors and fluent user/participant actions for composing, editing, deleting, threading, typing, scrolling, and links.
Message-list assertions
sample_app/integration_test/robots/user_robot_message_list_asserts.dart
Adds assertions for message states, overlays, pagination, link previews, cell sizing, and composer growth.
Message-list integration scenarios
sample_app/integration_test/message_list_test.dart
Adds coverage for rendering, editing, offline receipt, threads, deletion, mentions, scrolling, pagination, links, sizing, and composer limits.
iOS E2E execution setup
sample_app/fastlane/Fastfile
Boots eligible iOS simulators before retry attempts.

Thread typing indicator

Layer / File(s) Summary
Thread typing overlay
sample_app/lib/pages/thread_page.dart
Renders StreamTypingIndicator as a bottom overlay above the thread message list.

iOS framework embedding

Layer / File(s) Summary
Embedded Pod framework lists
sample_app/ios/Runner.xcodeproj/project.pbxproj
Replaces flutter_app_badger.framework with app_badge_plus.framework and adds stream_thumbnail.framework.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: velikovpetar, xsahil03x

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding end-to-end message list tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/message-list-tests

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
Contributor

Choose a reason for hiding this comment

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

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 `@sample_app/integration_test/support/widget_test_extensions.dart`:
- Around line 47-93: Replace the unbounded pumpAndSettle() calls in tapFinder,
scrollMessageList, and scrollUpUntilVisible with the bounded settle() helper
already used by the visibility methods. Preserve the existing sequencing and
ensure scrollUpUntilVisible’s timeout can be enforced between iterations even
when perpetual animations are active.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 20fd9c56-b7e3-4570-aada-4ceca4e1deac

📥 Commits

Reviewing files that changed from the base of the PR and between 2507ca5 and 1d0810c.

📒 Files selected for processing (10)
  • sample_app/fastlane/Fastfile
  • sample_app/integration_test/message_list_test.dart
  • sample_app/integration_test/pages/message_list_page.dart
  • sample_app/integration_test/robots/participant_robot.dart
  • sample_app/integration_test/robots/user_robot.dart
  • sample_app/integration_test/robots/user_robot_message_list_asserts.dart
  • sample_app/integration_test/support/stream_test_env.dart
  • sample_app/integration_test/support/widget_test_extensions.dart
  • sample_app/ios/Runner.xcodeproj/project.pbxproj
  • sample_app/lib/pages/thread_page.dart

Comment thread sample_app/integration_test/support/widget_test_extensions.dart
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.83%. Comparing base (b85e63a) to head (2eece57).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2854   +/-   ##
=======================================
  Coverage   72.83%   72.83%           
=======================================
  Files         428      428           
  Lines       27657    27657           
=======================================
  Hits        20144    20144           
  Misses       7513     7513           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@testableapple
testableapple marked this pull request as draft July 29, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant