Skip to content

test: Playwright tests run on their own accounts in fresh contexts - #385

Merged
HardMax71 merged 1 commit into
mainfrom
test/durable-playwright
Oct 13, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
test/durable-playwright

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

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: page for a guest, userPage and adminPage for the two roles. An api fixture is a client signed in as the worker's user, and execution starts 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 retrying expect, and hold the login and execute requests with page.route to check the loading states. Labels come from fieldTitle and 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 over ADMIN_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. The webServer entry is gone, since npm run dev proxies 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 lint and npm run format:check exit 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

  • page is a guest, userPage and adminPage are signed in; api is a client for the worker's user, and execution starts an execution through it so the admin executions and sagas tables have a row to find.
  • Specs are flat test() calls without describe wrappers or nested helpers; they wait for specific toasts and visible state with retrying expect and hold login and execute requests with page.route to check loading states.
  • Labels come from fieldTitle and 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 over ADMIN_ROUTES, and access control has its own spec.

Tooling

  • svelte-check and Prettier now cover e2e/, and CI fails a test that passes only on retry.
  • The webServer entry is gone because npm run dev proxies to a hostname that only resolves inside the compose network.

Written for commit 5d6eec1. Summary will update on new commits.

View guided diff Turn on auto-fix

…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
HardMax71 enabled auto-merge (squash) October 13, 2026 23:20
@github-actions github-actions Bot added documentation Improvements or additions to documentation area: frontend Svelte UI and the generated API client labels Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8354e4fb-71fb-4f4b-a1ce-f3d84e22ab32
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
frontend-unit 92.60% <ø> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

Components Coverage Δ
Backend 91.72% <ø> (ø)
Frontend 92.60% <ø> (+0.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit c20ffec into main Oct 13, 2026
22 of 23 checks passed
@HardMax71
HardMax71 deleted the test/durable-playwright branch October 13, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Svelte UI and the generated API client documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants