From d1bc3cf3bf84be50f1dd400e60da1ab8176184ec Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 18 May 2026 14:40:34 +0300 Subject: Choose Playwright for web UI smoke tests Co-Authored-By: Claude Sonnet 4.6 --- player-server/test/e2e-web/playwright.config.ts | 57 +++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 player-server/test/e2e-web/playwright.config.ts (limited to 'player-server/test/e2e-web/playwright.config.ts') diff --git a/player-server/test/e2e-web/playwright.config.ts b/player-server/test/e2e-web/playwright.config.ts new file mode 100644 index 0000000..26782bf --- /dev/null +++ b/player-server/test/e2e-web/playwright.config.ts @@ -0,0 +1,57 @@ +import { defineConfig, devices } from '@playwright/test'; + +// Base URL for the running player server. Override with the PLAYER_URL env var +// when testing against a non-default address or port. +const baseURL = process.env.PLAYER_URL || 'http://localhost:8080'; + +export default defineConfig({ + // Look for test files only inside the tests/ subdirectory. + testDir: './tests', + + // Run each test file in its own isolated context. Tests within the same + // file share a browser context by default (serial execution per file). + fullyParallel: false, + + // Fail the CI run on test.only left in source. + forbidOnly: !!process.env.CI, + + // Retry once on CI to absorb transient timing flakes. + retries: process.env.CI ? 1 : 0, + + // Single worker: the tests mutate shared server state (bootstrap, user + // accounts) so parallelism across workers would cause races. + workers: 1, + + reporter: [['list'], ['html', { open: 'never' }]], + + // Allow up to 120 s for the global beforeAll hook which triggers a media + // rescan and waits for at least one set to appear in the database. + globalTimeout: 120_000, + + use: { + baseURL, + + // Headless by default; PWDEBUG=1 or --headed enables the browser window. + headless: true, + + // Capture a screenshot on failure for easier CI debugging. + screenshot: 'only-on-failure', + + // Record a trace on the first retry to capture the failure timeline. + trace: 'on-first-retry', + + // Generous navigation timeout for the Go server to respond on CI. + navigationTimeout: 15_000, + actionTimeout: 10_000, + }, + + projects: [ + { + // Run against Chromium only. The smoke suite exercises application + // logic, not cross-browser compatibility. Add Firefox/WebKit when + // cross-browser coverage is needed. + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}); -- cgit v1.2.3