Files
EpicNext-Cms/playwright.ui.config.ts
T
openhands e870beb71c
CI / check (push) Failing after 20s
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / tests-imaging-browsers (push) Skipped
CI / tests-quality (push) Skipped
CI / preflight (push) Skipped
CI / deploy (push) Skipped
fix(ui): stub Node built-ins for fixture bundle
Replace platform: 'node' (incompatible with iife browser bundle) with
explicit aliases for node:async_hooks, node:crypto, node:fs/promises,
node:path pointing at e2e/ui/node-stubs.mjs. Provides shape-compatible
exports so esbuild can bundle the UI fixture without failing on Node
built-ins. Increase webServer timeout to 120s for reliable startup.
2026-10-17 16:11:52 +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: 120000,
reuseExistingServer: true,
env: { UI_TEST_PORT: String(port) },
},
});