Files
Lumotia/playwright.config.ts
Jake f03f8a01b0 v0.2 Phase 8: full release gate — all checks green
cargo fmt --check                                         ✓
  cargo clippy --workspace --all-targets -- -D warnings     ✓
  cargo test --workspace                                    ✓
  cargo nextest run --workspace                             ✓ 435/435
  npm run check                                             ✓ 0/0/5704 files
  npm test                                                  ✓ 13/13 (2 files)
  npm run test:browser                                      ✓ 3/3 in Chromium
  npm run test:e2e                                          ✓ 16/16 × 2 viewports
  npm run analyze                                           ✓ reports/bundle-stats.html (1.7 MB)
  scripts/dogfood-rebrand-drill.sh                          ✓ 8/8 (sandbox)
  npm run guard:no-skeleton                                 ✓ clean

Two small Phase 8 corrections landed alongside the gate:

vite.config.js: the jsdom suite was picking up
`src/lib/ui/*.browser.test.ts`, which only works under the
@vitest/browser-playwright provider. Added the browser-suffix glob to
the jsdom suite's exclude list so the two runners stop double-running
the same files.

playwright.config.ts: bumped the global `expect.timeout` to 15 s. The
cold first-compile of the Vite SPA tree was exceeding Playwright's
default 5 s `toBeVisible` timeout on the 900x700 project on dogfood
runs. The 1440x900 project (which runs second after a warm cache)
never hit it.

Phase 8 closes Phase-7 page migrations. Branch is ready for the
finishing-a-development-branch handoff.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 09:07:10 +01:00

45 lines
1.6 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
// Frontend-only E2E. The dev server is SvelteKit (npm run dev:frontend) on
// localhost:1420 — Tauri IPC is not present. Tests must not depend on Tauri
// commands; mock the invoke boundary if you need a Tauri-flavoured surface,
// or skip the assertion with a reason and cover it via `cargo test` instead.
//
// Visual diffs are NOT failing the build yet; screenshots are captured as
// artifacts. After Phase 7 stabilises the UI, a follow-up commit promotes
// baselines and enables failing diffs.
export default defineConfig({
testDir: "tests/e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: [["list"], ["html", { open: "never", outputFolder: "playwright-report" }]],
outputDir: "test-results",
// Vite's first compile of the SPA tree can blow past the default 5s
// expect timeout on cold runs (especially on the 900x700 project,
// which fires before any module cache is warm). Bumping the global
// expect timeout avoids per-test {timeout: …} sprinkles.
expect: { timeout: 15_000 },
use: {
baseURL: "http://localhost:1420",
trace: "on-first-retry",
screenshot: "only-on-failure",
},
projects: [
{
name: "chromium-900x700",
use: { ...devices["Desktop Chrome"], viewport: { width: 900, height: 700 } },
},
{
name: "chromium-1440x900",
use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 900 } },
},
],
webServer: {
command: "npm run dev:frontend",
url: "http://localhost:1420",
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});