Expose semantic testTags on chat-ui affordances#4
Merged
Conversation
Adds Compose Modifier.testTag(...) markers to the affordances that
both Compose UI tests (ethora-sdk-android/.../androidTest/) and
Maestro flows (ethora-sample-android/.maestro/flows/) need to
resolve at runtime. Without these, tests have to fall back to
contentDescription / text matching, which breaks under
localization, theming, and minor copy edits.
Tags added:
ChatInput
chat_input OutlinedTextField for the user's text
chat_send_button FAB (active) and disabled IconButton (empty
field) — same tag on both states so tests
can resolve "the send affordance" without
knowing whether text is present
chat_attach_button attach IconButton (hidden in edit mode)
MessageBubble
chat_message_image the MediaMessage subtree for media bubbles
RoomListView
rooms_list the LazyColumn rendering the room list
room_row each clickable room Surface
rooms_search_input the SearchBar OutlinedTextField
create_room_button the "+" Add IconButton in the top app bar
Each component declares its tag values in a small companion
`*TestTags` object at the end of the file (ChatInputTestTags,
MessageBubbleTestTags, RoomListViewTestTags), so source consumers
import constants rather than re-typing magic strings. This:
- keeps tags discoverable next to the composable they describe
- makes a tag rename a one-place change (the constant)
- documents in one place that tests + Maestro flows depend on
these values, so don't change them casually
No behavior change. testTag is a SemanticsModifier — purely
additive metadata that's only observable from accessibility /
test frameworks. Render tree, layout, click handling unchanged.
Companion changes in:
- ethora-sdk-android PR #3 (existing tests will be updated to
use onNodeWithTag(...) instead of content-description anchors)
- ethora-sample-android PR #2 (.maestro/flows/ already reference
these exact id values via id: "chat_input" / "chat_send_button"
etc., previously marked optional: true; once this lands those
can become required assertions)
This was referenced May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Compose `Modifier.testTag(...)` markers to the chat-ui affordances that both Compose UI tests and Maestro E2E flows need to resolve at runtime. Today tests have to fall back to `contentDescription` / text matching, which breaks under localization, theming, and minor copy edits.
Tags added
Pattern
Each component declares its tag values in a small companion `*TestTags` object at the end of the file:
```kotlin
object ChatInputTestTags {
const val INPUT_FIELD = "chat_input"
const val SEND_BUTTON = "chat_send_button"
const val ATTACH_BUTTON = "chat_attach_button"
}
```
Source consumers import constants rather than re-typing magic strings, so:
Behavior
No behavior change. `testTag` is a `SemanticsModifier` — purely additive metadata only observable from accessibility / test frameworks. Render tree, layout, click handling unchanged.
Companion PRs
Test plan