-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
47 lines (43 loc) · 1.38 KB
/
Copy pathplaywright.config.ts
File metadata and controls
47 lines (43 loc) · 1.38 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
import { defineConfig, devices } from '@playwright/test';
/**
* Playwright covers two kinds of tests in this repo:
* 1. `tests/e2e/build-output.spec.ts` — file-system assertions over `dist/`.
* These don't need a browser but ride along with the Playwright runner so
* they share CI job setup with the render specs.
* 2. `tests/e2e/render.spec.ts` — real browser assertions against the Astro
* preview server.
*
* Both require a prior `NODE_CMS_USE_FIXTURE=1 npm run build`. We don't build
* from Playwright because the build step is a prerequisite for dist-output
* assertions — building inside `webServer` would race.
*/
export default defineConfig({
testDir: 'tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list',
timeout: 30_000,
expect: { timeout: 5_000 },
use: {
baseURL: 'http://localhost:4321',
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npx astro preview --port 4321',
url: 'http://localhost:4321',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
NODE_CMS_USE_FIXTURE: '1',
},
},
});