mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-06-22 04:11:55 +10:00
dfd2c77bc9
* docs: design e2e test setup Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * docs: plan e2e test implementation Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * test: add playwright e2e scripts Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * test: configure playwright Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * test: add core e2e fixtures and specs Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * ci: run e2e tests on pull requests Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * [autofix.ci] apply automated fixes * test: stabilize e2e suite Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * test: ignore playwright artifacts Co-authored-by: Amruth Pillai <im.amruth@gmail.com> * Update .github/workflows/e2e.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * test: address e2e review feedback Co-authored-by: Amruth Pillai <im.amruth@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
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 = process.env.CI === "true" || process.env.CI === "1";
|
|
|
|
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),
|
|
},
|
|
},
|
|
});
|