Skip to content

test(e2e): add Playwright visual regression tests#863

Open
Alain-L wants to merge 3 commits into
dalibo:masterfrom
Alain-L:feature/e2e-tests
Open

test(e2e): add Playwright visual regression tests#863
Alain-L wants to merge 3 commits into
dalibo:masterfrom
Alain-L:feature/e2e-tests

Conversation

@Alain-L

@Alain-L Alain-L commented Jan 6, 2026

Copy link
Copy Markdown

Summary

Add visual regression tests using Playwright to catch unintended UI changes.

Usage

# Generate snapshots (first time or after UI changes)
npm run test:e2e:update

# Run tests (compare against existing snapshots)
npm run test:e2e

What's included

  • 171 tests: 14 samples × 4 tabs (Plan, Grid, Raw, Stats) + Home page × 3 browsers
  • Browsers: Chromium, Firefox, WebKit
  • Snapshots: Generated locally, not committed (each dev/CI generates their own)

Files added/modified

File Change
e2e/visual.spec.ts Test file
playwright.config.ts Playwright configuration
package.json Scripts and devDependency
vitest.config.ts Exclude e2e/ from unit tests
example/src/App.vue Expose window.samples for tests
.gitignore Exclude snapshots and reports

Notes

window.samples exposure: Tests load samples via window.samples instead of navigating through the UI. This is faster and more stable, but requires exposing data on window. This could be wrapped in if (import.meta.env.DEV) if preferred.

Snapshots not committed: Snapshots are generated locally and excluded from git. This avoids bloating the repo but means each environment generates its own baseline, which can cause inconsistencies (fonts, rendering). Committing CI-generated snapshots as reference could be considered to follow best practices.

Screenshots in HTML report: By default, screenshots only appear in the report on failure. To include them for passing tests, use testInfo.attach():

test("Plan tab", async ({ page }, testInfo) => {
  // ...
  await testInfo.attach("screenshot", { body: await page.screenshot(), contentType: "image/png" })
  await expect(page).toHaveScreenshot(...)
})

alesage added 3 commits January 6, 2026 14:19
Add comprehensive e2e tests using Playwright with visual snapshots:
- 14 sample plans tested across light and dark themes
- 114 total visual regression tests (14 samples × 4 tabs × 2 themes + 2 home)
- Playwright configuration with dev server integration
- Export window.samples for test access to sample plans
- Exclude e2e folder from vitest to avoid conflicts
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