Skip to content

test(e2e): drive the web app as two people and record both - #6

Open
jdsika wants to merge 3 commits into
config/web-imagefrom
feat/web-e2e
Open

jdsika wants to merge 3 commits into
config/web-imagefrom
feat/web-e2e

Conversation

@jdsika

@jdsika jdsika commented Nov 14, 2026 •

Copy link
Copy Markdown

A Playwright suite under deploy/e2e that drives the web app as two people in two browser contexts and records both: sign-in through a login module named in E2E_PROVIDER_LOGIN or MAS's password form, a recovery key set up and stored, a space, a room and an invitation, messages, formatting with the rich text editor, a reply, a thread, a mention, read receipts, reactions, a PNG with a caption, a JPEG, an MP4, a GIF file, a GIF from the GIF search when the configuration sets a provider, a caption edit, a direct chat with a picture, a pin, a poll, room search, renaming the room and its topic, sign out and back in with the recovery key.

A second flow, tests/bots.spec.ts, records a deployment that gives each person a bot, which joins a room only when every member agrees. A ping is checked to carry an intentional mention of the bot (m.mentions), so the flow also proves the rich text editor's mentions reach the room. The first person creates a private room in the space and invites the second; both agree to the first person's bot through the app's own Matrix client, since the app has no place for it yet; the bot declines while one has not agreed, joins once both have, answers a mention with "ping" from either person with "pong", and leaves when a member withdraws or mentions it with "leave". It runs only with E2E_BOT_LOCALPART_PREFIX and E2E_BOT_CONSENT_EVENT_TYPE; E2E_BOT_LOCALPART_SUFFIX names what follows the person's localpart in their bot's user ID, for a deployment whose bots carry one.

Each run writes steps.json with a screenshot per step and an ARIA snapshot per failed step to its output directory (output, or E2E_OUTPUT_DIR), keeps a trace per flow, and assemble.sh joins both recordings side by side with captions and a title card (end-to-end.mp4, or E2E_OUTPUT_NAME). Each flow runs on its own, into an output directory of its own. locators.md lists the accessible names the suite relies on. apps/web/Dockerfile.dockerignore keeps the suite out of the image.

Fork-only: the suite depends on this fork's deployment contract and its feature branches.

deploy/e2e is a Playwright suite that signs two people in, each in a
Chromium context of its own, and walks them through nine flows: a
recovery key from the encryption settings, the organisation's space, a
room in it and an invitation, messages with bold text, inline code and
a code block, a reply, a thread, a mention, read receipts, reactions,
an image with a caption, a JPEG, a video, a GIF, a direct chat with a
picture, a pin, a poll, a search, a new room name and topic, and
signing out and back in with the recovery key. It finds Element's
widgets by role and name (locators.md), since a production build keeps
only the shared components' test ids. It records both contexts, logs
every step with its time and screenshots to output/steps.json and
keeps a trace per flow; assemble.sh joins the recordings side by side
with captions and a title card.

Sign-in hands the page to the login module named in E2E_PROVIDER_LOGIN,
or fills in MAS's password form; people, the space and the URL come
from E2E_STATE_FILE or the environment. Recovery keys go to a 0600 file
and are blurred in the recordings, output/ is readable by its owner
only, and certificate errors and identity resets are opt-in. The suite
has its own package.json outside the pnpm workspace, and the image
build leaves it out of its context.

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
@jdsika jdsika added the fork-only Stays in the fork; nothing to send upstream label Nov 14, 2026
tests/bots.spec.ts is a second recording flow for a deployment that
gives each person a bot, which joins a room only when every member
agrees. The same two people sign in; the first creates a private room
from the space's own menu and invites the second; the first agrees to
their bot and invites it, and the bot declines while the second has not
agreed, then joins once both have; a mention with "ping" from either
gets "pong"; the bot leaves when the second withdraws and, invited
back, when the first mentions it with "leave". The client has no place
to agree to bots, so the power levels and the consent state events go
through the app's own Matrix client in the page, which also tells the
bot's membership and messages apart; both windows must show each of
them, found by its event ID. The flow runs only with
E2E_BOT_LOCALPART_PREFIX and E2E_BOT_CONSENT_EVENT_TYPE.

E2E_OUTPUT_DIR moves a run's output: a relative one begins with
"output", which git ignores, and the suite refuses to empty a directory
that holds files but no steps.json. E2E_OUTPUT_NAME names the video
assemble.sh writes. A run records each person once, so the two flows
run one at a time. The helpers both flows use moved from chat.spec.ts
into src/; an invitation also confirms "The following users may not
exist", and an account without a recovery key no longer stalls the
confirmation of a new device.

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
A deployment may put something after the person's localpart in their bot's user ID. The bot flow
takes it from E2E_BOT_LOCALPART_SUFFIX, empty when unset, and the README names it.

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork-only Stays in the fork; nothing to send upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant