-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
44 lines (41 loc) · 1.18 KB
/
Copy pathplaywright.config.ts
File metadata and controls
44 lines (41 loc) · 1.18 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
import { defineConfig, devices } from '@playwright/test';
const PORT = Number(process.env['PORT'] ?? 4173);
/**
* Escape hatch for environments that already ship a Chromium build which does
* not match the one this Playwright version downloads. CI installs the
* matching browser and leaves this unset.
*/
const executablePath = process.env['PLAYWRIGHT_CHROMIUM_EXECUTABLE'];
/**
* E2E configuration.
*
* `dist/` must be built first; `bun run test:e2e` does that for you.
*/
export default defineConfig({
testDir: './tests/e2e',
testMatch: '**/*.spec.ts',
fullyParallel: true,
forbidOnly: Boolean(process.env['CI']),
retries: process.env['CI'] ? 1 : 0,
reporter: process.env['CI'] ? 'list' : 'line',
use: {
baseURL: `http://127.0.0.1:${PORT}`,
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
...(executablePath ? { launchOptions: { executablePath } } : {}),
},
},
],
webServer: {
command: `bun run tests/e2e/server.ts`,
url: `http://127.0.0.1:${PORT}/panel.html`,
reuseExistingServer: !process.env['CI'],
env: { PORT: String(PORT) },
stdout: 'ignore',
},
});