Repository navigation
Conversation
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>
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>
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.
A Playwright suite under
deploy/e2ethat drives the web app as two people in two browser contexts and records both: sign-in through a login module named inE2E_PROVIDER_LOGINor 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 withE2E_BOT_LOCALPART_PREFIXandE2E_BOT_CONSENT_EVENT_TYPE;E2E_BOT_LOCALPART_SUFFIXnames what follows the person's localpart in their bot's user ID, for a deployment whose bots carry one.Each run writes
steps.jsonwith a screenshot per step and an ARIA snapshot per failed step to its output directory (output, orE2E_OUTPUT_DIR), keeps a trace per flow, andassemble.shjoins both recordings side by side with captions and a title card (end-to-end.mp4, orE2E_OUTPUT_NAME). Each flow runs on its own, into an output directory of its own.locators.mdlists the accessible names the suite relies on.apps/web/Dockerfile.dockerignorekeeps the suite out of the image.Fork-only: the suite depends on this fork's deployment contract and its feature branches.