Skip to content

e2e: Cover poll creation and voting - #6649

Merged
andremion merged 5 commits into
developfrom
andrerego/and-1330-polls-e2e-coverage
Aug 20, 2026
Merged

e2e: Cover poll creation and voting#6649
andremion merged 5 commits into
developfrom
andrerego/and-1330-polls-e2e-coverage

Conversation

@andremion

@andremion andremion commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Goal

Cover polls end to end in the Compose sample: creating a poll from the attachment picker, voting and removing a vote in the message list, a participant vote arriving over the websocket, and ending a poll.

Requires the mock server poll support from GetStream/stream-chat-test-mock-server#62. The workflow runs linked below pass mock_server_branch until it merges.

Resolves AND-1330

Implementation

  • New PollsTests with five tests, plus the poll page objects (CreatePollPage and a Poll section in MessageListPage), the UserRobot actions (createPoll, castPollVote, removePollVote, openPollResults, endPoll) and UserRobotPollAsserts.
  • ParticipantRobot gains castPollVote(option) and addPollAnswer(answer), backed by the new mock robot route participant/poll_vote.
  • The poll UI had no test tags, so the SDK now exposes them: the creation dialog (Stream_PollQuestionInput, Stream_PollOptionInput, Stream_PollAddOptionButton, Stream_PollCreateButton), the poll bubble (Stream_PollOptionVotingRow plus one tag per action button), the end-poll confirmation (Stream_PollEndConfirmButton) and the picker button (Stream_AttachmentPickerCreatePollButton). FullscreenDialog and the end-poll AlertDialog render in their own windows, so they now set testTagsAsResourceId, the same way StreamModalBottomSheet already does. No behavior change; PollButtons had its answers branch extracted into a private PollAnswersButton to stay under the detekt method length limit.
  • Selector notes, learned from local device runs: the text inputs are selected as the EditText inside the tagged container, because setting text on any other node is silently ignored. A vote is asserted through the option row's toggle state, which waits out the vote round trip. The default PollPickerMode auto-opens the creation dialog when the Polls tab is selected, so the picker button is never tapped.
  • The participant vote test waits for the poll message delivery before the vote (a vote for a message the server does not have yet is rejected), and asserts the vote count in the message list before opening the results dialog, because the dialog renders the poll as selected at tap time.

Testing

  • All five PollsTests are green locally against the mock server PR branch (API 35 emulator, per-test data isolation, five out of five), re-run after rebasing onto the latest develop.
  • spotlessCheck, detekt, apiCheck (no public API changes, the touched composables are internal or private) and :stream-chat-android-compose:verifyPaparazziDebug all pass. The tags do not change rendering.
  • E2E workflow runs on this branch with the mock server branch: PollsTests, 3 batches and the full API matrix.

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for creating polls, displaying poll messages, voting, removing votes, viewing results, and ending polls.
    • Added test support for creating polls and validating options, vote counts, results, and closed states.
  • Chores
    • Improved UI test accessibility for poll controls, inputs, dialogs, and voting rows.
    • Added participant poll interactions, including voting and submitting answers.

@andremion andremion added the pr:test Test-only changes label Aug 19, 2026
@github-actions

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 Aug 19, 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.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.02 MB 6.02 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.32 MB 11.32 MB 0.00 MB 🟢
stream-chat-android-compose 12.80 MB 12.80 MB 0.00 MB 🟢

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a8d12eb-1579-4eae-a652-ffc1198ccf0d

📥 Commits

Reviewing files that changed from the base of the PR and between 2ed73fe and 94b9665.

📒 Files selected for processing (13)
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/pages/CreatePollPage.kt
  • 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/UserRobotPollAsserts.kt
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/PollsTests.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/FullscreenDialog.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/PollMessageContent.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollOptionVotingRow.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/AttachmentPollPicker.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/PollCreationHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/PollOptionList.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/PollQuestionInput.kt
  • stream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/ParticipantRobot.kt

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The change adds poll UI test tags, page selectors, robot actions, participant poll operations, assertion helpers, and end-to-end tests for poll creation, voting, results, vote removal, and poll closure.

Changes

Poll UI instrumentation and selectors

Layer / File(s) Summary
Poll UI test instrumentation
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/PollMessageContent.kt, .../poll/PollOptionVotingRow.kt
Poll actions, answer controls, voting rows, and end-poll confirmation controls now expose test tags.
Poll creation UI selectors
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/FullscreenDialog.kt, .../messages/attachments/*
Poll creation inputs and buttons now expose test tags. Dialog content exposes tags as resource IDs.

Poll test APIs and scenarios

Layer / File(s) Summary
Poll page objects and robot actions
stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/pages/*, .../robots/UserRobot.kt
Page selectors and fluent robot methods now create polls, cast or remove votes, open results, and end polls.
Poll assertions and end-to-end tests
stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/robots/UserRobotPollAsserts.kt, .../tests/PollsTests.kt, stream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/robots/ParticipantRobot.kt
Assertions and tests cover poll display, voting, vote removal, participant results, and closed polls. Participant poll requests URL-encode option and answer values.

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

Merge Risk: ⚪ Minimal · up to 94b96

This PR adds end-to-end poll coverage and test tags without reported behavior changes; the listed checks and poll workflows pass, so no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant PollsTests
  participant UserRobot
  participant CreatePollPage
  participant PollMessage
  participant ParticipantRobot
  PollsTests->>UserRobot: createPoll(question, options)
  UserRobot->>CreatePollPage: enter question and options
  CreatePollPage->>PollMessage: submit poll
  UserRobot->>PollMessage: cast or remove vote
  ParticipantRobot->>PollMessage: post participant vote
  UserRobot->>PollMessage: open results or end poll
  PollsTests->>UserRobot: assert poll state
Loading

Suggested reviewers: gpunto

Poem

A rabbit taps tags in a poll-lit room,
Options appear and votes find bloom.
Results hop in, the close bell rings,
Tests check the state of all poll things.
“Thump, thump!” says Bun, “the flow is clear!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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
Title check ✅ Passed The title clearly summarizes the main change: adding end-to-end coverage for poll creation and voting.
Description check ✅ Passed The description covers the goal, implementation, testing results, dependencies, and affected UI test tags; optional visual and checklist sections are omitted.
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.
✨ Finishing Touches 💡 1
📝 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-1330-polls-e2e-coverage

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.

@andremion
andremion marked this pull request as ready for review August 19, 2026 12:43
@andremion
andremion requested a review from a team as a code owner August 19, 2026 12:43
@andremion
andremion enabled auto-merge August 19, 2026 12:43
@sonarqubecloud

Copy link
Copy Markdown

@andremion
andremion added this pull request to the merge queue Aug 20, 2026
Merged via the queue into develop with commit d09cbfb Aug 20, 2026
19 checks passed
@andremion
andremion deleted the andrerego/and-1330-polls-e2e-coverage branch August 20, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:test Test-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants