Skip to content

Add Playwright E2E smoke tests (production-like build)#26

Merged
kayodebristol merged 2 commits intomainfrom
e2e-smoke
Feb 4, 2026
Merged

Add Playwright E2E smoke tests (production-like build)#26
kayodebristol merged 2 commits intomainfrom
e2e-smoke

Conversation

@kayodebristol
Copy link
Contributor

@kayodebristol kayodebristol commented Feb 1, 2026

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 preview server, 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. Updates package.json/lockfile to include @playwright/test and adds test:e2e/test:all scripts, plus a playwright.config.ts webServer setup; flake.nix npm deps hash is updated accordingly.

Written by Cursor Bugbot for commit 750683c. This will update automatically on new commits. Configure here.

const before = await page.locator('body').innerText();
await btn.click();
const after = await page.locator('body').innerText();
expect(after).not.toEqual(before);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@kayodebristol
Copy link
Contributor Author

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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@kayodebristol kayodebristol merged commit 14cd86d into main Feb 4, 2026
6 of 7 checks passed
@kayodebristol kayodebristol deleted the e2e-smoke branch February 4, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant