-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
48 lines (45 loc) · 1.22 KB
/
playwright.config.ts
File metadata and controls
48 lines (45 loc) · 1.22 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
import { defineConfig, devices } from '@playwright/test'
import dotenv from 'dotenv'
import { minutesToMilliseconds, secondsToMilliseconds } from 'date-fns'
dotenv.config()
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: process.env.CI ? 'blob' : 'html',
timeout: secondsToMilliseconds(45),
reportSlowTests: {
max: 5,
threshold: minutesToMilliseconds(10),
},
use: {
baseURL: process.env.CI ? 'https://www.localhost' : 'http://localhost:3000',
trace: 'retain-on-failure',
},
projects: [
// Setup project
{
name: 'setup',
testMatch: /.*\.setup\.ts/,
use: { ...(process.env.CI ? { ignoreHTTPSErrors: true } : {}) },
},
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], ...(process.env.CI ? { ignoreHTTPSErrors: true } : {}) },
dependencies: ['setup'],
},
// {
// name: 'firefox',
// use: {
// ...devices['Desktop Firefox'],
// ...(process.env.CI ? { ignoreHTTPSErrors: true } : {}),
// },
// dependencies: ['setup'],
// },
],
})