Files
EpicNext-Cms/playwright.ui.config.ts
T
openhands 728999b2de
CI / check (push) Successful in 28s
CI / tests-unit (push) Successful in 1m32s
CI / tests-integration (push) Successful in 1m37s
CI / tests-imaging-browsers (push) Successful in 2m20s
CI / tests-quality (push) Successful in 54s
CI / tests-ui (push) Failing after 16m47s
CI / preflight (push) Skipped
CI / deploy (push) Skipped
feat(ui): multi-browser coverage for Playwright UI tests
Add firefox and webkit projects alongside chromium (desktop/mobile),
and enable reuseExistingServer so the fixture server isn't restarted
per run. Chromium/Firefox/WebKit browsers installed via
npx playwright install.
2026-10-17 16:05:27 +02:00

72 lines
1.8 KiB
TypeScript

import { defineConfig } from "@playwright/test";
const port = Number(process.env.UI_TEST_PORT || 3107);
if (!Number.isInteger(port) || port < 1024 || port > 65535)
throw Error("Invalid UI_TEST_PORT");
const baseURL = `http://127.0.0.1:${port}`;
export default defineConfig({
testDir: "./e2e/ui",
testMatch: "**/*.spec.ts",
fullyParallel: false,
workers: 1,
retries: process.env.CI ? 1 : 0,
timeout: 45000,
expect: {
timeout: 10000,
toHaveScreenshot: {
animations: "disabled",
caret: "hide",
maxDiffPixelRatio: 0.002,
},
},
snapshotPathTemplate: `{testDir}/__screenshots__/${process.platform}/{projectName}/{testFilePath}/{arg}{ext}`,
reporter: [
["list"],
["html", { outputFolder: "playwright-report/ui", open: "never" }],
],
outputDir: "test-results/ui",
use: {
baseURL,
locale: "en-US",
timezoneId: "UTC",
colorScheme: "dark",
contextOptions: { reducedMotion: "reduce" },
trace: "retain-on-failure",
screenshot: "only-on-failure",
launchOptions: process.env.UI_TEST_BROWSER_PATH
? { executablePath: process.env.UI_TEST_BROWSER_PATH }
: {},
},
projects: [
{
name: "desktop-chromium",
use: { browserName: "chromium", viewport: { width: 1280, height: 900 } },
},
{
name: "mobile-chromium",
use: {
browserName: "chromium",
viewport: { width: 390, height: 844 },
isMobile: true,
deviceScaleFactor: 1,
hasTouch: true,
},
},
{
name: "desktop-firefox",
use: { browserName: "firefox", viewport: { width: 1280, height: 900 } },
},
{
name: "desktop-webkit",
use: { browserName: "webkit", viewport: { width: 1280, height: 900 } },
},
],
webServer: {
command: "node e2e/ui/fixture-server.mjs",
url: `${baseURL}/health`,
timeout: 60000,
reuseExistingServer: true,
env: { UI_TEST_PORT: String(port) },
},
});