forked from docsifyjs/docsify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.js
64 lines (58 loc) · 1.49 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
58
59
60
61
62
63
64
const { devices } = require('@playwright/test');
/**
* @see https://playwright.dev/docs/test-configuration
* @type {import('@playwright/test').PlaywrightTestConfig}
*/
const config = {
// Setup / Teardown
globalSetup: './test/config/playwright.setup.js',
globalTeardown: './test/config/playwright.teardown.js',
// Test Execution
expect: {
timeout: 5000,
},
retries: process.env.CI ? 2 : 0, // Retry on CI only
testDir: './test/e2e',
timeout: 30 * 1000,
workers: process.env.CI ? 1 : undefined, // No parallel tests on CI
forbidOnly: !!process.env.CI, // Fail on CI if test.only in source
// Output
outputDir: './_playwright-results/', // screenshots, videos, traces, etc.
reporter: [
[
'html',
{
open: 'never',
outputFolder: '_playwright-report',
},
],
],
snapshotDir: './test/e2e/__snapshots__',
// Config - Shared
// See https://playwright.dev/docs/api/class-testoptions
use: {
actionTimeout: 0,
baseURL: `${process.env.TEST_HOST}`, // Allow relative page.goto() (e.g. `await page.goto('/')`).
trace: 'on-first-retry',
},
// Projects
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] }
// },
],
};
module.exports = config;