frontend-quality-gates / merge / browser tests (r1, w2) (pull_request) Successful in 5m38s
frontend-quality-gates / merge / browser tests (r1, w3) (pull_request) Successful in 4m44s
frontend-quality-gates / merge / browser tests (r1, w4) (pull_request) Successful in 4m33s
frontend-quality-gates / merge / browser tests (r1, w6) (pull_request) Successful in 4m38s
frontend-quality-gates / merge / browser tests (r2, w2) (pull_request) Successful in 5m36s
frontend-quality-gates / merge / browser tests (r2, w3) (pull_request) Successful in 4m44s
frontend-quality-gates / merge / browser tests (r2, w4) (pull_request) Successful in 4m33s
frontend-quality-gates / merge / browser tests (r2, w6) (pull_request) Successful in 4m39s
frontend-quality-gates / merge / browser tests (r3, w2) (pull_request) Successful in 5m37s
frontend-quality-gates / merge / browser tests (r3, w3) (pull_request) Successful in 4m47s
frontend-quality-gates / merge / browser tests (r3, w4) (pull_request) Successful in 4m33s
frontend-quality-gates / merge / browser tests (r3, w6) (pull_request) Successful in 4m37s
90 lines
3.0 KiB
TypeScript
90 lines
3.0 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
import { flakyJudgement, flakyJudgementReporter } from "./scripts/lib/playwright-flaky-judgement.ts";
|
|
import {
|
|
reservePort,
|
|
RUN_OUTPUT_ROOT_VARIABLE,
|
|
TEST_PORT_VARIABLES,
|
|
testRunPath,
|
|
testRunRoot,
|
|
} from "./scripts/lib/run-isolation.ts";
|
|
import { childProcessTimeout } from "./tests/helpers/child-process-timeout.ts";
|
|
|
|
// 1105/12-04. With TEST_RUN_ID set, this run's results, report and the build
|
|
// its preview serves are under .tmp/runs/<id>/ (scripts/lib/run-isolation.ts),
|
|
// so a second run in the same checkout neither empties this run's dist nor
|
|
// deletes its results. Unset, the paths are artifacts/tests/e2e/* and dist,
|
|
// which FE-GATE-008 and the CI upload read. The preview listens on a free
|
|
// port (TEST_E2E_PORT pins one); a fixed 4173 made the second run fail with
|
|
// "is already used".
|
|
const dist = testRunPath("dist");
|
|
const port = await reservePort(TEST_PORT_VARIABLES.e2e);
|
|
const origin = `http://127.0.0.1:${port}`;
|
|
|
|
const benchWorkers = process.env["CI_PLAYWRIGHT_WORKERS"]
|
|
? Number.parseInt(process.env["CI_PLAYWRIGHT_WORKERS"], 10)
|
|
: undefined;
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e",
|
|
...(benchWorkers ? { workers: benchWorkers } : {}),
|
|
// Fixture specs build a repository copy once for the run, not once per
|
|
// browser project (tests/e2e/support/shared-fixture-builds.ts).
|
|
globalSetup: "./tests/e2e/support/e2e-global-setup.ts",
|
|
forbidOnly: true,
|
|
...flakyJudgement(),
|
|
outputDir: testRunPath("artifacts/tests/e2e/results"),
|
|
reporter: [
|
|
["list"],
|
|
flakyJudgementReporter,
|
|
["html", { outputFolder: testRunPath("artifacts/tests/e2e/report"), open: "never" }],
|
|
[
|
|
"junit",
|
|
{ outputFile: testRunPath("artifacts/tests/e2e/results.xml"), includeRetries: true },
|
|
],
|
|
],
|
|
use: {
|
|
baseURL: origin,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
},
|
|
webServer: {
|
|
env: { [RUN_OUTPUT_ROOT_VARIABLE]: testRunRoot() },
|
|
// REV-FE-0015. The wait covers the build: longest start 3,880 ms on desktop
|
|
// (2026-11-23, 3 runs), sized like a child process of a test
|
|
// (tests/helpers/child-process-timeout.ts). test:a11y inherits it.
|
|
timeout: childProcessTimeout(3_880),
|
|
command:
|
|
`corepack pnpm build && corepack pnpm preview --host 127.0.0.1 --port ${port} --strictPort --outDir ${dist}`,
|
|
url: origin,
|
|
reuseExistingServer: false,
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
testIgnore: "**/compact-smoke.spec.ts",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
{
|
|
name: "firefox",
|
|
testIgnore: "**/compact-smoke.spec.ts",
|
|
use: { ...devices["Desktop Firefox"] },
|
|
},
|
|
{
|
|
name: "webkit",
|
|
testIgnore: "**/compact-smoke.spec.ts",
|
|
use: { ...devices["Desktop Safari"] },
|
|
},
|
|
{
|
|
name: "chromium-compact",
|
|
testMatch: "**/compact-smoke.spec.ts",
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
viewport: { width: 390, height: 844 },
|
|
hasTouch: true,
|
|
isMobile: true,
|
|
},
|
|
},
|
|
],
|
|
});
|