Expand Playwright suite with auth-flow + chat-component testid scaffold#101
Merged
Conversation
…tIds Three new files under tests/e2e/, expanding coverage from the existing 3-test public-page smoke suite. None of the new tests modify host source code — they observe what's already there. tests/e2e/_chatComponentTestIds.ts (new) Local mirror of @ethora/chat-component's public testid constants (ChatInputTestIds, MessageBubbleTestIds, RoomListTestIds, AuthTestIds). The chat-component package exports these via its src/main.ts in dappros/ethora-chat-component#71; once that lands and a version >= 26.3.18 publishes, swap the inline definitions for an `import from '@ethora/chat-component'`. Until then, the local mirror keeps this PR landable independently of the upstream merge. String values match Android's *TestTags Kotlin objects (in ethora-sdk-android's chat-ui module) and iOS's *AccessibilityID Swift enums (in ethora-sdk-swift's XMPPChatUI/AccessibilityIdentifiers.swift), so a Playwright test using `[data-testid="chat_input"]` exercises the same intent as a Maestro flow with `id: "chat_input"` on either mobile platform. Three platforms, one selector contract. tests/e2e/auth-flows.spec.ts (new) Three runnable tests against the host's own login form (the one in src/pages/AuthPage/Login/Steps/LoginForm.tsx, distinct from chat-component's <Login> for embed scenarios): - login form rejects empty submit with required-field validation - login form rejects invalid email format with regex error - login form posts to /v1/users/login-with-email on valid input Mocks /v1/apps/get-config with the same fixture shape as smoke.spec.ts. The third test intercepts the login POST, asserts the body has the right email + password, then replies 401 to short-circuit the post-login bootstrap chain (which would need /me, /apps/get-config-by-token, /chats/my, etc. mocked too). Behavior we want — "submit fired with the right body" — is observed before that complexity matters. tests/e2e/chat-flows.spec.ts (new) Three test.fixme()-flagged stubs for chat-component coverage: - mounts the room list when the user lands on /app/chat - send a message via the chat input - attach button is visible and enabled when media is allowed Each stub references the right testid constants, has a brief body showing the expected flow, and is left fixme until the post-login bootstrap mocks are wired (or the suite gains a PLAYWRIGHT_REAL_BACKEND=1 mode that points at chat-qa). The shape and selector anchors are in place so filling each in is a mechanical follow-up. Pre-existing concern flagged: the dev branch's existing smoke tests (smoke.spec.ts) currently fail locally — the app boots into a loading-spinner state because some non-/v1/apps/get-config API call isn't mocked. This PR doesn't fix that (out of scope), but the auth-flows tests will fail in the same way until the underlying boot-path issue is resolved. Once that's addressed (probably another mock route for whatever endpoint changed), the auth-flow tests should pass on their own merits.
Expands the Browser Smoke Tests section with what each new spec covers + a cross-platform testing overview table showing how this repo's Playwright e2e layer is the Web Layer 2 counterpart to Maestro on mobile. Selector contract: [data-testid='chat_input'] here resolves the same intent as id: 'chat_input' in any Maestro flow. The testid constants in tests/e2e/_chatComponentTestIds.ts mirror the public testIds exported by @ethora/chat-component.
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
Expands the e2e Playwright suite from 3 public-page smoke tests to 9 (3 existing + 3 runnable new + 3 fixme'd stubs). Establishes single-source-of-truth testid constants matching Android `*TestTags` and iOS `*AccessibilityID`, so Playwright resolves the same chat-component nodes that mobile Maestro flows do.
Files
Cross-platform parity (now four-way)
A Maestro YAML using `id: "chat_input"` and a Playwright test using `[data-testid="chat_input"]` now resolve to the same intent on Android, iOS, and Web.
Pre-existing issue flagged
The existing `smoke.spec.ts` tests fail locally on `dev` — the app boots into a loading-spinner state because some API call beyond `/v1/apps/get-config` isn't mocked (likely a chat-component SDK boot fetch added in a recent bump). Not introduced by this PR. The new `auth-flows.spec.ts` tests will fail in the same way until that root cause is addressed (probably one extra route mock).
Once that's resolved, the 3 new auth-flow tests pass on their merits, and the 3 chat-flow stubs unfreeze as we wire post-login bootstrap mocks (or add a `PLAYWRIGHT_REAL_BACKEND=1` mode pointing at `chat-qa`).
Test plan
Companion PRs