/
playwright.config.ts
90 lines (69 loc) · 2.05 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
// Test location
testDir: './tests',
outputDir: './reports/artifacts',
// Wheter to run spec files sequentially
fullyParallel: false,
// Fail build on CI if there are tests marked as 'only'.
forbidOnly: !!process.env.CI,
// Amount of retries on failure (flaky test)
retries: process.env.CI ? 1 : 1,
// Amount of jobs to run in parallel
workers: process.env.CI ? 1 : 1,
// Maximum time expect() should wait to met a condition
expect: { timeout: 6 * 1000 },
globalTeardown: "./global-teardown.ts",
// Reporter to use. See https://playwright.dev/docs/test-reporters
reporter: [
['list'],
["allure-playwright", { detail: true }],
['html', { outputFolder: './reports/html-reports', open: 'never' }]
// To generate Azure Pipeline Results use the following reporter
// ['junit', { outputFile: 'test-results/junit.xml' }],
],
use: {
actionTimeout: 10 * 1000, // Maximum time each action like click() can take
viewport: { width: 1500, height: 730 },
headless: true,
ignoreHTTPSErrors: true,
acceptDownloads: true,
screenshot: 'only-on-failure',
video: 'on-first-retry',
trace: 'on-first-retry',
},
/* Configure projects for major browsers */
projects: [
{
name: 'Chrome',
use: { channel: 'chrome' },
},
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'Microsoft Edge',
// use: { channel: 'msedge' },
// },
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
{
name: 'Mobile Safari',
use: { ...devices['iPhone 12'] },
}
],
// In case you need to run your local env before the tests run
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
module.exports = exports.default;