-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathplaywright.config.generators-crud.ts
More file actions
48 lines (47 loc) · 1.69 KB
/
Copy pathplaywright.config.generators-crud.ts
File metadata and controls
48 lines (47 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig, devices } from "@playwright/test";
import dotenv from "dotenv";
dotenv.config({ path: ".env.local" });
/**
* Phase 2 config for the generator e2e suite: drives the admin panel through
* real CRUD against the sister nestjs-boilerplate API.
*
* The orchestrator (run-crud.sh) is responsible for booting the NestJS Docker
* stack on host:3001 BEFORE running this config. Playwright's `webServer` here
* only manages the Next.js process.
*/
export default defineConfig({
testDir: "./playwright-tests/generators",
testMatch: /generators-crud\.spec\.ts$/,
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: 0,
workers: 1,
// "list" alone produces no report and no traces, so a CI failure here leaves
// nothing to diagnose from — keep the console output and add both.
reporter: [["list"], ["html", { open: "never" }]],
timeout: 2 * 60 * 1000,
expect: { timeout: 20 * 1000 },
use: {
baseURL: "http://localhost:3000",
// retries are 0 here, so "on-first-retry" never captures anything.
trace: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: {
// CI builds for production, as playwright.config.ts does: `next dev` compiles
// each route on first visit, which pushes page loads past the 20s expect
// timeout on a cold CI runner. (`build:e2e` used to be unusable here because
// its BSD `cp -n` exited 1 when `.env.local` existed; that is fixed.)
command: process.env.CI
? "npm run build:e2e && npm run start"
: "npm run dev",
url: "http://127.0.0.1:3000",
reuseExistingServer: !process.env.CI,
timeout: 5 * 60 * 1000,
},
});