test(e2e): playwright - two browsers play online, server shop, offline campaign (P4-2)

This commit is contained in:
Benjamin Oezcan
2026-11-19 09:47:22 +01:00
parent dd120f47f8
commit fade816169
11 changed files with 257 additions and 6 deletions

32
playwright.config.js Normal file
View File

@@ -0,0 +1,32 @@
// Browser end-to-end tests (npm run e2e). Uses the installed Google Chrome (no browser download) and starts its own
// server on port 8099 with a fresh throw-away database (tests/e2e/server.js).
'use strict';
const { defineConfig } = require('@playwright/test');
const PORT = 8099;
module.exports = defineConfig({
testDir: 'tests/e2e',
testMatch: '**/*.spec.js',
timeout: 90 * 1000,
expect: { timeout: 15 * 1000 },
fullyParallel: false,
workers: 1,
retries: 0,
reporter: [['list']],
use: {
baseURL: `http://127.0.0.1:${PORT}`,
channel: 'chrome',
headless: true,
viewport: { width: 1280, height: 720 },
launchOptions: { args: ['--enable-unsafe-swiftshader', '--use-angle=swiftshader', '--autoplay-policy=no-user-gesture-required'] },
trace: 'retain-on-failure',
},
webServer: {
command: 'node tests/e2e/server.js',
url: `http://127.0.0.1:${PORT}/healthz`,
env: { PORT: String(PORT) },
reuseExistingServer: false,
timeout: 30 * 1000,
},
});