a9cd7750f4
CI / unit-test (push) Has been cancelled
CI / detect-changes (push) Has been cancelled
CI / build (push) Has been cancelled
Publish docs via GitHub Pages / Deploy docs (push) Has been cancelled
CI / test-harness (push) Has been cancelled
CI / generate-e2e-matrix (push) Has been cancelled
CI / e2e (push) Has been cancelled
CI / build-ui (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
UI v2 Integration CI / E2E (Integration) (push) Has been cancelled
UI v2 CI / Lint, Format & Test (push) Has been cancelled
UI v2 CI / E2E (Mocked) (push) Has been cancelled
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
/**
|
|
* Playwright E2E test configuration.
|
|
*
|
|
* Tests live in e2e/ and run against the production bundle served on port 5000.
|
|
* The server proxies /api to a Conductor backend (default: localhost:8080);
|
|
* individual test files use page.route() to intercept and mock those calls so
|
|
* the suite can run without a live backend.
|
|
*
|
|
* See https://playwright.dev/docs/test-configuration
|
|
*/
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
|
|
fullyParallel: true,
|
|
|
|
// Fail the build on CI if test.only is accidentally committed.
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
retries: process.env.CI ? 2 : 0,
|
|
|
|
// Limit concurrency on CI to avoid resource contention.
|
|
workers: process.env.CI ? 1 : undefined,
|
|
|
|
reporter: [["html", { outputFolder: "playwright-report" }]],
|
|
|
|
use: {
|
|
baseURL: "http://localhost:5000",
|
|
|
|
// Collect traces on the first retry of a failed test for debugging.
|
|
trace: "on-first-retry",
|
|
|
|
// Capture screenshots only on failure.
|
|
screenshot: "only-on-failure",
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
],
|
|
|
|
// Serve the production bundle before the test run.
|
|
// In CI the bundle is already built by a prior step, so just serve it.
|
|
// Locally, build first then serve; an existing server on port 5000 is reused.
|
|
webServer: {
|
|
command: process.env.CI ? "yarn preview" : "yarn build && yarn preview",
|
|
url: "http://localhost:5000",
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120_000,
|
|
},
|
|
});
|