-
Notifications
You must be signed in to change notification settings - Fork 131
/
playwright.config.ts
38 lines (36 loc) · 1.01 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
import { defineConfig, devices } from '@playwright/test';
import { config } from 'dotenv';
config();
export default defineConfig({
testDir: './tests',
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.02,
},
},
reporter: [['list'], ['html']],
use: {
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL,
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'retain-on-failure',
extraHTTPHeaders: {
'x-vercel-protection-bypass': process.env.VERCEL_PROTECTION_BYPASS || '',
'x-vercel-set-bypass-cookie': process.env.CI ? 'true' : 'false',
},
},
projects: [
{
name: 'tests-chromium',
use: {
...devices['Desktop Chrome'],
launchOptions: {
// When redirected to checkout, BigCommerce blocks preflight requests from a HeadlessChrome user agent.
// We need to disable web security to allow the preflight request to go through.
args: ['--disable-web-security'],
},
},
},
],
retries: 1,
});