Files
sencho/playwright.config.ts
T
Anso 1115650e78 chore(ci): drop auto screenshot refresh job, switch to manual capture (#884)
The release-only `update-screenshots` job opened a `chore/refresh-screenshots`
PR and immediately tried to squash-merge it. Branch protection (1 review,
6 status checks) rejected the merge on every release, leaving an open PR
behind. Screenshots will instead be refreshed manually after UI changes.

Removed:
- The `update-screenshots` job from ci.yml (~57 lines).
- The `paths-ignore: docs/images/**` push trigger filter; its sole purpose
  was to break the auto-merge re-trigger cascade. Its absence also fixes a
  latent bug where docs-only pushes to main would have skipped sync-docs.
- Four `head_ref != 'chore/refresh-screenshots'` guards in other jobs.
- The "doc screenshots" mention in the skip-bot-PRs comment.

Reworked the screenshot capture spec to be opt-in:
- playwright.config.ts now defines two projects. The default `chromium`
  project ignores screenshots.spec.ts; a separate `screenshots` project
  matches it and is invoked manually.
- The e2e CI job runs `--project=chromium` so the screenshots project
  cannot accidentally run in CI.
- Updated the spec's module comment with the new manual invocation.

Net: 86 lines removed, 27 added.
2026-05-02 15:57:45 -04:00

49 lines
1.5 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E config for Sencho.
*
* Before running: ensure both dev servers are up:
* cd backend && npm run dev &
* cd frontend && npm run dev &
*
* Or use the webServer config below (which starts them automatically).
*/
export default defineConfig({
testDir: './e2e',
// Don't stop on first failure - show all results
maxFailures: 0,
// How long to wait for a single test
timeout: 30_000,
// How long to wait for an expect() assertion
expect: { timeout: 5_000 },
// Run tests serially - Sencho is a single-user app and tests share DB state
workers: 1,
reporter: [['list'], ['html', { outputFolder: 'e2e/report', open: 'never' }]],
use: {
baseURL: 'http://localhost:5173',
// Persist auth state between tests in the same file
storageState: undefined,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{
// Default project: skips the manual screenshot capture spec so
// `npx playwright test` does not regenerate docs images on every run.
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
testIgnore: ['**/screenshots.spec.ts'],
},
{
// Manual-only project for capturing docs/images/. Run explicitly:
// npx playwright test --project=screenshots
name: 'screenshots',
use: { ...devices['Desktop Chrome'] },
testMatch: ['**/screenshots.spec.ts'],
},
],
});