Add Playwright E2E smoke tests (production-like build)#26
Add Playwright E2E smoke tests (production-like build)#26kayodebristol merged 2 commits intomainfrom
Conversation
| const before = await page.locator('body').innerText(); | ||
| await btn.click(); | ||
| const after = await page.locator('body').innerText(); | ||
| expect(after).not.toEqual(before); |
There was a problem hiding this comment.
Race condition in test after button click
Low Severity
The test captures innerText() immediately after btn.click() without waiting for async DOM updates. Since this app uses Svelte 5 (which batches state updates asynchronously), clicking a button likely triggers a reactive state change that updates the DOM in the next microtask. The synchronous expect(after).not.toEqual(before) assertion doesn't auto-wait, causing potential false negatives where the test fails despite the button working correctly. Playwright's auto-waiting assertions (like await expect(locator).not.toContainText(...)) are designed to handle this.
|
CI Build was failing due to Nix fixed-output hash mismatch after package-lock change. I updated flake.nix to the new value from the CI log (got: sha256-bTjHsr/TVOZ850v+dxqcOre9hO+QopAIqgQNckiSf3M=). This should unblock the Nix Build job. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| src = ./.; | ||
|
|
||
| npmDepsHash = "sha256-S2tAn2QEmj5ry9COmE/dxJEAjlxiugazvN9WxE/IyNE="; | ||
| npmDepsHash = "sha256-bTjHsr/TVOZ850v+dxqcOre9hO+QopAIqgQNckiSf3M="; |
There was a problem hiding this comment.
Missing npmDepsHash update breaks runebook-agent-pkg Nix build
High Severity
The npmDepsHash was updated for the frontend package but not for runebook-agent-pkg. Both packages use src = ./. and depend on the same package-lock.json, which changed when @playwright/test was added. The runebook-agent-pkg at line 123 still has the old hash (sha256-S2tAn2QEmj5ry9COmE/dxJEAjlxiugazvN9WxE/IyNE=), causing nix build .#runebook-agent to fail with a hash mismatch.


Adds Playwright E2E smoke testing against built output (npm run build + preview).
Goal: catch "build green, UI broken" regressions by verifying at least one browser interaction.
Artifacts: Playwright traces/screenshots on failure.
Note
Low Risk
Low risk: adds new E2E test tooling and a GitHub Actions workflow without changing runtime application code; main risk is CI flakiness or longer build times.
Overview
Adds Playwright-based E2E smoke coverage that runs against a production-like
vite build+vite previewserver, including a basic navigation/assertion and optional first-button click check.Introduces a new GitHub Actions workflow to run E2E on PRs and
main, installs Playwright browsers, and uploads the Playwright report artifact. Updatespackage.json/lockfile to include@playwright/testand addstest:e2e/test:allscripts, plus aplaywright.config.tswebServer setup;flake.nixnpm deps hash is updated accordingly.Written by Cursor Bugbot for commit 750683c. This will update automatically on new commits. Configure here.