mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-06-22 04:11:55 +10:00
4fb4a6c5f0
Co-authored-by: Amruth Pillai <im.amruth@gmail.com>
45 lines
1020 B
TypeScript
45 lines
1020 B
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const port = Number.parseInt(process.env.PORT ?? "3000", 10);
|
|
const baseURL = process.env.APP_URL ?? `http://localhost:${port}`;
|
|
const isCI = Boolean(process.env.CI);
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e/specs",
|
|
fullyParallel: true,
|
|
forbidOnly: isCI,
|
|
retries: isCI ? 2 : 0,
|
|
workers: isCI ? 2 : undefined,
|
|
timeout: 60_000,
|
|
expect: {
|
|
timeout: 10_000,
|
|
},
|
|
reporter: isCI
|
|
? [["list"], ["github"], ["junit", { outputFile: "test-results/e2e-junit.xml" }]]
|
|
: [["list"], ["html", { open: "never" }]],
|
|
use: {
|
|
baseURL,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
video: "retain-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
],
|
|
webServer: {
|
|
command: "pnpm start",
|
|
url: `${baseURL}/api/health`,
|
|
reuseExistingServer: !isCI,
|
|
timeout: 120_000,
|
|
env: {
|
|
...process.env,
|
|
APP_URL: baseURL,
|
|
NODE_ENV: "production",
|
|
PORT: String(port),
|
|
},
|
|
},
|
|
});
|