Files
VoxVera/playwright.config.js
thePR0M3TH3ANandClaude Opus 4.8 c5b2c20fc9 Add cross-browser e2e tests, field-limit cheat sheet, and docs
Verification:
- Add Playwright harness (e2e/) covering Chromium, Firefox, and WebKit plus
  Android/iOS mobile emulations. Smoke tests assert: default flyer renders
  with no JS/console errors, @media print hides app chrome and keeps the
  flyer, anonymous npub generation (WebCrypto), legacy /nostr/ redirect
  preserves query+hash, and event-lookup URLs show the loading state instead
  of the default flyer. All six projects pass.
- package.json/playwright.config.js wire up the projects and a managed static
  server; .gitignore excludes node_modules and Playwright output.

Docs:
- docs/flyer-field-limits.md: per-script character cheat sheet for each flyer
  field (single-line caps + multi-line guidance), measured by rendering each
  script at print size.
- README: add a Features section matching the shipping client and a
  cross-browser verification section; link the cheat sheet.
- AGENTS.md: document the e2e suite and the one-time WebKit Linux dep.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-09 15:29:49 -04:00

53 lines
1.8 KiB
JavaScript

// @ts-check
const { defineConfig, devices } = require("@playwright/test");
// Cross-browser + cross-device coverage for the static client. The same site
// is exercised on each desktop engine (Chromium/Firefox/WebKit) and on mobile
// emulations (Android Chrome, iOS Safari, and a mobile-viewport Firefox).
//
// WebKit is the engine behind Safari (macOS) and every iOS browser, so the
// `webkit` and `Mobile Safari` projects are our proxy for the Apple ecosystem
// without a Mac in the loop. Playwright manages the static server itself.
const PORT = 8799;
module.exports = defineConfig({
testDir: "./e2e",
timeout: 30000,
expect: { timeout: 7000 },
fullyParallel: true,
forbidOnly: !!process.env.CI,
reporter: [["list"], ["html", { open: "never" }]],
use: {
baseURL: `http://127.0.0.1:${PORT}`,
trace: "on-first-retry",
screenshot: "only-on-failure"
},
webServer: {
command: `python3 -m http.server ${PORT} --directory site`,
url: `http://127.0.0.1:${PORT}/`,
reuseExistingServer: !process.env.CI,
timeout: 30000
},
projects: [
// ---- Desktop engines ----
{ name: "chromium-desktop", use: { ...devices["Desktop Chrome"] } },
{ name: "firefox-desktop", use: { ...devices["Desktop Firefox"] } },
{ name: "webkit-desktop", use: { ...devices["Desktop Safari"] } },
// ---- Mobile emulations ----
{ name: "chrome-android", use: { ...devices["Pixel 5"] } },
{ name: "safari-ios", use: { ...devices["iPhone 13"] } },
// Playwright's Firefox engine does not support touch/isMobile device
// descriptors, so this is a mobile-viewport layout check only (no touch).
{
name: "firefox-mobileviewport",
use: {
...devices["Desktop Firefox"],
viewport: { width: 412, height: 915 }
}
}
]
});