Repository navigation
test: Playwright tests run on their own accounts in fresh contexts - #385
Merged
Merged
Conversation
…d wait on the page Every worker registers its own account through the API and signs it and the seeded admin in once, so workers never share a user's settings, scripts or notifications. Each test gets a fresh browser context from those cookies, so localStorage no longer leaks from one test to the next, and clearSession is gone. An api fixture and an execution fixture give tests a signed-in client and a started execution, which turns the five skipped notification tests into real ones and gives the admin tables rows to check. Specs are flat test() calls with no describe wrappers or nested helpers. They assert on specific toasts and visible state with retrying expect, never a timeout loop, and hold a request with page.route to see a loading state. Labels come from fieldTitle and option lists from the generated enums and schemas. The admin pages share one data-driven spec for heading and sidebar, and access control has its own spec. svelte-check and Prettier now cover e2e/. CI retries a failed test once and fails on flaky ones. The webServer entry is gone, since npm run dev can't reach the API from the host.
HardMax71
enabled auto-merge (squash)
October 13, 2026 23:20
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.


The Playwright suite shared one seeded user across workers and one browser context across a worker's tests, so settings, saved scripts, the editor draft and the theme leaked between tests. Several tests could not fail, five were skipped, and the execution helper polled the API in a sleep loop.
Each worker now registers its own account through the API and signs it and the seeded admin in once. Every test gets a fresh context built from those cookies:
pagefor a guest,userPageandadminPagefor the two roles. Anapifixture is a client signed in as the worker's user, andexecutionstarts an execution through it. That makes the notification tests real (read, delete, mark all) and gives the admin executions and sagas tables a row to find.Specs are flat
test()calls without describe wrappers or helpers defined inside functions. They wait for specific toasts and visible state with retryingexpect, and hold the login and execute requests withpage.routeto check the loading states. Labels come fromfieldTitleand option lists from the generated enums and Zod schemas, so a new execution status or saga state shows up in the tests by itself. The admin heading and sidebar checks are one data-driven spec overADMIN_ROUTES, and access control has its own.svelte-check and Prettier now cover
e2e/, and the type check caught two wrong assertions on the way. CI keeps one retry for a second trace and fails a test that passes only on the retry. ThewebServerentry is gone, sincenpm run devproxies to a hostname that only resolves inside compose.Ran locally against the stack with k3s in Docker: 86 passed in about 42 seconds, three runs in a row on the same database, then 258 of 258 with 6 workers and
--repeat-each=3.npm run check,npm run lintandnpm run format:checkexit 0.Summary by cubic
Reworks the Playwright suite so every worker registers its own account through the API and each test gets a fresh browser context built from those cookies. State like user settings, saved scripts, editor drafts, and theme no longer leaks between tests, and the five previously skipped notification tests now exercise read, delete, and mark-all for real.
Test structure
pageis a guest,userPageandadminPageare signed in;apiis a client for the worker's user, andexecutionstarts an execution through it so the admin executions and sagas tables have a row to find.test()calls without describe wrappers or nested helpers; they wait for specific toasts and visible state with retryingexpectand hold login and execute requests withpage.routeto check loading states.fieldTitleand option lists from generated enums and Zod schemas, so a new status or state shows up in the tests on its own. Admin heading and sidebar checks are one data-driven spec overADMIN_ROUTES, and access control has its own spec.Tooling
svelte-checkand Prettier now covere2e/, and CI fails a test that passes only on retry.webServerentry is gone becausenpm run devproxies to a hostname that only resolves inside the compose network.Written for commit 5d6eec1. Summary will update on new commits.