-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplaywright.config.js
57 lines (51 loc) · 1.23 KB
/
playwright.config.js
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
import { defineConfig, devices } from '@playwright/test'
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './playwright/tests',
fullyParallel: true,
// Increase timeout for CI to minimize test flakiness
timeout: process.env.ci ? 50000 : 30000,
expect: {
timeout: process.env.ci ? 10000 : 5000,
},
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
// One worker on CI to make tests more stable
workers: process.env.CI ? 1 : 3,
reporter: [
[
process.env.CI ? 'blob' : 'html',
{
attachments: true,
},
],
],
use: {
baseURL: 'http://localhost:5678/',
trace: 'on-first-retry',
screenshot: {
mode: 'on',
fullPage: true,
},
},
/* Configure projects for major browsers */
projects: [
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
{
name: 'Microsoft Edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
},
],
/* Run the local dev server before starting the tests */
webServer: {
command: 'npm run test:start',
url: 'http://localhost:5678',
reuseExistingServer: !process.env.CI,
},
})