52 lines
2.4 KiB
TypeScript
52 lines
2.4 KiB
TypeScript
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
// The web UI's end-to-end suite (docs/fabrica.md, part 5): the built UI in a real browser against
|
|
// the demo control plane (tests/demo.ts, invented data only), served on 127.0.0.1 by e2e/serve.ts.
|
|
// Two projects:
|
|
// web the main flows of ROADMAP §4, each recorded as a video (target/e2e/videos/<flow>.webm);
|
|
// Fabrica's `web` target (.fabrica/tests.yaml) and its e2e pipeline run this one.
|
|
// aula the release's screenshots (target/e2e/aula/<name>.png), which `fabrica aula shots` checks
|
|
// and publishes (.fabrica/aula.yaml, `file:` shots).
|
|
// Every page is drawn at a fixed instant in a fixed zone, so two takes of a screen are the same.
|
|
// On Windows the browser is the installed Edge (PW_CHANNEL names another, e.g. chrome): nothing is
|
|
// downloaded. Elsewhere it is Playwright's own Chromium. Videos need Playwright's ffmpeg, which lives
|
|
// in PLAYWRIGHT_BROWSERS_PATH (on F: on Mark's PC, never C:).
|
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const channel = process.env.PW_CHANNEL ?? (process.platform === "win32" ? "msedge" : undefined);
|
|
// Fabrica's live view (Fabrica docs/20_tests.md part 3): the port its Tests page watches.
|
|
const devtools = process.env.FABRICA_TESTS_DEVTOOLS ? [`--remote-debugging-port=${process.env.FABRICA_TESTS_DEVTOOLS}`] : [];
|
|
|
|
const desktop = {
|
|
...devices["Desktop Chrome"],
|
|
...(channel ? { channel } : {}),
|
|
viewport: { width: 1440, height: 900 },
|
|
deviceScaleFactor: 1,
|
|
locale: "en-GB",
|
|
timezoneId: "Europe/Prague",
|
|
launchOptions: { args: ["--lang=en-GB", ...devtools] },
|
|
};
|
|
|
|
export default defineConfig({
|
|
testDir: "e2e/specs",
|
|
outputDir: "../../target/e2e/results",
|
|
globalSetup: "./e2e/serve.ts",
|
|
fullyParallel: false,
|
|
workers: 1,
|
|
retries: 0,
|
|
forbidOnly: !!process.env.CI,
|
|
// Generous: the release PC runs several apps' suites at once, and a loaded PC types and draws slowly
|
|
// (one Edge start took 45 s there, one flow 72 s). A real hang still ends.
|
|
timeout: 180_000,
|
|
expect: { timeout: 15_000 },
|
|
reporter: [["list"]],
|
|
use: { trace: "retain-on-failure" },
|
|
projects: [
|
|
{ name: "web", testMatch: "flows.spec.ts", use: { ...desktop, video: { mode: "on", size: { width: 1440, height: 900 } } } },
|
|
{ name: "aula", testMatch: "aula.spec.ts", use: desktop },
|
|
],
|
|
});
|