-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplaywright.config.ts
67 lines (63 loc) · 1.57 KB
/
playwright.config.ts
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
63
64
65
66
67
import { defineConfig, devices } from '@playwright/test';
const BASE_URL = 'http://localhost:3000';
export default defineConfig({
testDir: './tests',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 3 : 1,
reporter: [['html', { open: 'never' }], ['dot']],
timeout: 2 * 60 * 1000,
expect: {
timeout: 5 * 1000,
},
use: {
headless: true,
ignoreHTTPSErrors: true,
acceptDownloads: true,
testIdAttribute: 'data-testid',
baseURL: BASE_URL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
actionTimeout: 5 * 1000,
navigationTimeout: 15 * 1000,
},
projects: [
{
name: 'chromium',
use: {
viewport: null,
launchOptions: {
args: ['--disable-web-security', '--start-maximized'],
slowMo: 0,
headless: false,
},
},
},
{
name: 'chromiumheadless',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1600, height: 1000 },
launchOptions: {
args: ['--disable-web-security'],
slowMo: 0,
headless: true,
},
},
},
],
/**
* If the tests are being run on localhost, this configuration starts a web server.
* See https://playwright.dev/docs/test-webserver#configuring-a-web-server
*/
webServer: {
command: 'npm start', // Start the UI server
url: BASE_URL,
ignoreHTTPSErrors: true,
timeout: 2 * 60 * 1000,
reuseExistingServer: true,
stdout: 'pipe',
stderr: 'pipe',
},
});