Files
OSIT-AE-App-Svelte/playwright.config.ts
Scott Idem af02e38528 test: badge E2E tests — fix __version wipe, extract idb_helpers, add render + workflow tests
Root cause fix: tests/_helpers/ae_defaults.ts was missing __version: 1, causing
store_versions.ts to wipe ae_loc from localStorage on every test page load. This
made trusted_access fall back to false, hiding the print button (can_print guard)
and failing all attendee workflow tests.

Changes:
- ae_defaults.ts: add __version: 1 with comment explaining the store_versions guard
- idb_helpers.ts: extract inject_badge_and_template() from print layout test into
  shared helper; now used by all three print/render test files
- event_badge_render.test.ts: new — 4 tests covering full_name_override priority,
  full_name fallback, duplex=0 hides badge back, duplex=1 shows badge back
- event_badge_attendee_workflow.test.ts: cleaned up (diagnostic code removed);
  all 3 tests now pass
- event_badge_print_layout.test.ts: renamed from badge_print_layout.test.ts;
  inline inject_idb() replaced with shared idb_helpers import
- event_badge_smoke.test.ts: renamed from event_badge.test.ts
- playwright.config.ts: use system /usr/bin/chromium on Arch Linux (avoids
  Playwright's bundled Chromium which requires Ubuntu libs not present on Arch)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 16:58:55 -04:00

26 lines
773 B
TypeScript

import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run dev',
port: 5173,
reuseExistingServer: true,
},
testDir: 'tests',
testMatch: 'tests/**/*.test.ts',
testIgnore: ['tests/disabled/**'],
reporter: 'list',
use: {
baseURL: 'http://demo.localhost:5173',
// baseURL: 'https://dev-demo.oneskyit.com',
trace: 'on-first-retry',
// Arch Linux: Playwright's downloaded Chromium requires Ubuntu system libs (libicu74 etc.)
// that don't exist on Arch. Use the system Chromium package instead.
launchOptions: {
executablePath: '/usr/bin/chromium',
},
}
};
export default config;