Files
Sable/tests/e2e
7w1 4edda08cac fix: submit the m.oauth stage type when completing OAuth UIA (#1348)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Fixes #

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
2026-07-25 16:00:56 -05:00
..

End-to-end tests

Playwright drives the real app (vite dev on :8080) against a throwaway Continuwuity homeserver started per run. The suite covers functional flows (login, sync, navigation, timeline) and captures screenshots for layout regression.

Requirements

  • Docker running (a Continuwuity container is started via testcontainers).

Running

pnpm test:e2e                  # functional tests on the host (screenshots skipped)
pnpm test:e2e:docker           # full suite, browser in the pinned container
pnpm test:e2e:docker:update    # regenerate screenshot baselines
pnpm test:e2e:ui               # interactive UI mode
pnpm test:e2e:report           # open the last HTML report

Screenshot baselines are rendered in mcr.microsoft.com/playwright:<version>-noble, because font rendering differs between hosts. Regenerate them with test:e2e:docker:update, never on the host. Visual tests skip unless PW_TEST_CONNECT_WS_ENDPOINT is set.

How it works

global-setup.ts:

  1. Starts a Continuwuity container with open registration.
  2. Registers a user and seeds deterministic rooms/messages over the client-server API.
  3. Injects the session into the app's localStorage (matrixSessions + matrixActiveSession) and saves it as Playwright storageState, so specs start already logged in without driving the login UI.

The container is stopped in the returned teardown.

Adding a test

Specs live in tests/e2e/*.spec.ts and run against both a desktop and a mobile viewport. Assert behaviour with locators; add toHaveScreenshot where a layout baseline is useful. Screenshot baselines live in tests/e2e/__screenshots__.

Notes when adding screenshots:

  • Mask dynamic content (time elements, the room-intro creation line).
  • The message timeline is virtualised, so its item positions shift between runs; snapshot the surrounding layout rather than the timeline itself.
  • folds renders Text as p, so getByRole('heading') will not match titles.