generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplaywright.config.js
45 lines (44 loc) · 1.15 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
import { defineConfig, devices } from '@playwright/test';
const BASE_URL = 'http://127.0.0.1';
const PORT = 1313;
export default defineConfig({
testDir: './src',
fullyParallel: true,
workers: 1,
outputDir: './test-results',
snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}',
reporter: [['html', { outputFolder: './playwright-report' }]],
use: {
baseURL: `${BASE_URL}:${PORT}`,
screenshots: 'only-on-failure',
video: 'retain-on-failure',
trace: 'on-first-retry',
timezoneId: 'America/Los_Angeles',
},
projects: [
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
],
webServer: {
command: `cd ../exampleSite && hugo mod get && hugo --gc -e production && hugo serve --port ${PORT}`,
url: `${BASE_URL}:${PORT}`,
stdout: 'ignore',
},
expect: {
toHaveScreenshot: {
pathTemplate:
'{testDir}/__screenshots__{/projectName}/{testFilePath}/{arg}{ext}',
maxDiffPixels: 10,
},
},
});