2026-04-17 14:15:27 +08:00
|
|
|
import path from "node:path";
|
|
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
|
|
2026-04-30 16:11:33 +08:00
|
|
|
const authFile = path.join(__dirname, ".playwright", ".auth", "analytics-user.json");
|
2026-04-20 10:56:47 +08:00
|
|
|
|
|
|
|
|
// Point raw-fetch tests (api.spec, security.spec, people.spec, rbac.spec) at
|
|
|
|
|
// the Docker container instead of the dev-server default (port 13490).
|
2026-04-20 15:03:56 +08:00
|
|
|
// Start the container with: SKIP_MUST_CHANGE_PASSWORD=true docker compose -f docker/docker-compose.yml up -d
|
2026-04-26 02:53:02 +08:00
|
|
|
const containerUrl = process.env.BASE_URL || "http://localhost:1349";
|
|
|
|
|
process.env.API_URL ??= containerUrl;
|
2026-04-17 14:15:27 +08:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-04-27 01:13:32 +08:00
|
|
|
testDir: "./tests/e2e-docker",
|
2026-04-20 15:03:56 +08:00
|
|
|
timeout: 600_000,
|
2026-04-17 14:15:27 +08:00
|
|
|
expect: {
|
2026-04-20 15:03:56 +08:00
|
|
|
timeout: 60_000,
|
2026-04-17 14:15:27 +08:00
|
|
|
},
|
|
|
|
|
fullyParallel: false,
|
|
|
|
|
retries: 0,
|
|
|
|
|
workers: 1,
|
|
|
|
|
reporter: [["html", { open: "never" }], ["list"]],
|
|
|
|
|
use: {
|
2026-04-26 02:53:02 +08:00
|
|
|
baseURL: containerUrl,
|
2026-04-17 14:15:27 +08:00
|
|
|
screenshot: "only-on-failure",
|
|
|
|
|
trace: "retain-on-failure",
|
|
|
|
|
},
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
name: "setup",
|
|
|
|
|
testMatch: /auth\.setup\.ts/,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "chromium",
|
|
|
|
|
use: {
|
|
|
|
|
...devices["Desktop Chrome"],
|
|
|
|
|
storageState: authFile,
|
|
|
|
|
},
|
|
|
|
|
dependencies: ["setup"],
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-04-20 10:56:47 +08:00
|
|
|
// No webServer — tests run against the Docker container at localhost:1349
|
2026-04-17 14:15:27 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export { authFile };
|