-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
62 lines (61 loc) · 1.52 KB
/
playwright.config.ts
File metadata and controls
62 lines (61 loc) · 1.52 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: 'tests',
timeout: 30 * 1000,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
forbidOnly: Boolean(process.env.CI),
webServer: [
{
command: 'pnpm run multi-example',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
{
command: 'pnpm run preview-vv',
url: 'http://localhost:5176/testbase',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
],
use: {
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'multi-example',
testDir: 'e2e/vite-webpack-rspack',
use: {
baseURL: 'http://localhost:5173',
browserName: 'chromium',
},
},
{
name: 'vite-vite-remote',
testDir: 'e2e/vite-vite/tests',
testMatch: 'remote-preview.spec.ts',
use: {
baseURL: 'http://localhost:5176/testbase',
browserName: 'chromium',
},
},
{
name: 'vite-vite-host',
testDir: 'e2e/vite-vite/tests',
testMatch: 'host-preview.spec.ts',
use: {
baseURL: 'http://localhost:5175',
browserName: 'chromium',
},
},
],
outputDir: 'reports/e2e/output',
reporter: [
['list'],
['html', { outputFolder: 'reports/e2e/playwright-report', open: 'never' }],
['json', { outputFile: 'reports/e2e/test-results.json' }],
],
});