2026-06-15 22:26:24 +08:00
|
|
|
import path from "node:path";
|
|
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
2026-07-27 15:37:30 +08:00
|
|
|
import { resolvePlaywrightRun } from "../playwright-run.js";
|
2026-06-15 22:26:24 +08:00
|
|
|
|
|
|
|
|
// QA sweep config: drives the isolated QA Docker container (auth off) with REAL
|
|
|
|
|
// Google Chrome (channel "chrome") so proprietary codecs (H.264/AAC/MP3) decode
|
|
|
|
|
// and media previews are valid. No webServer: the container is external.
|
|
|
|
|
//
|
|
|
|
|
// docker compose -f tests/qa/docker-compose.qa.yml up -d
|
|
|
|
|
// pnpm playwright test --config tests/qa/playwright.qa.config.ts
|
|
|
|
|
|
|
|
|
|
const QA_BASE_URL = process.env.QA_BASE_URL || "http://localhost:13499";
|
|
|
|
|
const repoRoot = path.join(__dirname, "..", "..");
|
2026-07-27 15:37:30 +08:00
|
|
|
const { runRoot } = resolvePlaywrightRun(repoRoot, "production-qa");
|
2026-06-15 22:26:24 +08:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
testDir: ".",
|
|
|
|
|
testMatch: /.*\.qa\.spec\.ts$/,
|
|
|
|
|
// Generous default; long/AI specs raise their own via test.setTimeout().
|
|
|
|
|
timeout: 120_000,
|
|
|
|
|
expect: { timeout: 15_000 },
|
|
|
|
|
fullyParallel: true,
|
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
|
retries: process.env.QA_RETRIES ? Number(process.env.QA_RETRIES) : 0,
|
|
|
|
|
// Conservative: the same machine runs the container doing FFmpeg/LibreOffice/AI.
|
|
|
|
|
workers: process.env.QA_WORKERS ? Number(process.env.QA_WORKERS) : 4,
|
|
|
|
|
reporter: [
|
|
|
|
|
["list"],
|
2026-07-27 15:37:30 +08:00
|
|
|
["json", { outputFile: path.join(runRoot, "results.json") }],
|
|
|
|
|
["html", { open: "never", outputFolder: path.join(runRoot, "playwright-report") }],
|
2026-06-15 22:26:24 +08:00
|
|
|
],
|
2026-07-27 15:37:30 +08:00
|
|
|
outputDir: path.join(runRoot, "playwright-output"),
|
2026-06-15 22:26:24 +08:00
|
|
|
use: {
|
|
|
|
|
baseURL: QA_BASE_URL,
|
|
|
|
|
screenshot: "only-on-failure",
|
|
|
|
|
trace: "retain-on-failure",
|
|
|
|
|
video: "off",
|
|
|
|
|
actionTimeout: 20_000,
|
|
|
|
|
navigationTimeout: 30_000,
|
|
|
|
|
},
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
name: "qa-chrome",
|
|
|
|
|
use: { ...devices["Desktop Chrome"], channel: "chrome" },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
});
|