summaryrefslogtreecommitdiff
path: root/player-server/test/e2e-web/playwright.config.ts
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-18 14:40:34 +0300
committerPaul Buetow <paul@buetow.org>2026-05-18 14:40:34 +0300
commitd1bc3cf3bf84be50f1dd400e60da1ab8176184ec (patch)
treec30daf7e52bd51ea03183f4ea9f083baf27c725e /player-server/test/e2e-web/playwright.config.ts
parentb5f97eb3adae3a80cc4fd47ea34a5dc83cba01b0 (diff)
Choose Playwright for web UI smoke tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'player-server/test/e2e-web/playwright.config.ts')
-rw-r--r--player-server/test/e2e-web/playwright.config.ts57
1 files changed, 57 insertions, 0 deletions
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'] },
+ },
+ ],
+});