56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import { defineConfig } from "@playwright/test";
|
|
import process from "node:process";
|
|
|
|
const PORT = process.env.PORT ?? "8080";
|
|
const BASE_URL = process.env.E2E_BASE_URL ??
|
|
`http://127.0.0.1:${PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e",
|
|
timeout: 60_000,
|
|
expect: {
|
|
timeout: 10_000,
|
|
},
|
|
fullyParallel: true,
|
|
workers: process.env.CI ? 2 : 1,
|
|
retries: process.env.CI ? 2 : 0,
|
|
reporter: [
|
|
["list"],
|
|
["html", { outputFolder: "playwright-report", open: "never" }],
|
|
["json", { outputFile: "test-results/test-results.json" }],
|
|
["junit", { outputFile: "test-results/junit-results.xml" }],
|
|
],
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
video: "retain-on-failure",
|
|
actionTimeout: 10_000,
|
|
navigationTimeout: 15_000,
|
|
viewport: { width: 1280, height: 720 },
|
|
locale: "en-US",
|
|
timezoneId: "UTC",
|
|
colorScheme: "light",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: {
|
|
browserName: "chromium",
|
|
},
|
|
},
|
|
],
|
|
webServer: {
|
|
command: "deno task dev",
|
|
url: BASE_URL,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 180_000,
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
env: {
|
|
PORT,
|
|
HOSTNAME_DENO: "127.0.0.1",
|
|
},
|
|
},
|
|
});
|