-
Notifications
You must be signed in to change notification settings - Fork 2
/
playwright.config.ts
67 lines (60 loc) · 1.65 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
import { defineConfig, devices } from '@playwright/test';
import { config } from './config';
const formattedDateTime = () => {
const d = new Date();
const month = `${String(d.getMonth() + 1).padStart(2, '0')}`;
const day = `${String(d.getDate() + 1).padStart(2, '0')}`;
const hour = `${String(d.getHours()).padStart(2, '0')}`;
const min = `${String(d.getMinutes()).padStart(2, '0')}`;
const date = `${d.getFullYear()}-${month}-${day}`;
const time = `${hour}.${min}.${d.getSeconds()}`;
return `${date}T${time}`;
};
const reportName = () => `${process.env.CATEGORY}/${formattedDateTime()}`;
/**
* See https://playwright.dev/docs/test-configuration.
*
* Timeouts were set by `ms`
*/
export default defineConfig({
workers: 1,
// Timeout for each test
timeout: 2 * 60 * 1000,
// Maximum time the whole test suite can run
globalTimeout: 20 * 60 * 1000,
testDir: './tests',
reporter: [
[
'html',
{
outputFolder: `playwright-report/${reportName()}`,
open: 'never',
},
],
],
expect: {
timeout: 2 * 60 * 1000, // set to 2min
},
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// This is set in config/index.ts
baseURL: config.baseURL,
actionTimeout: 2 * 60 * 1000, // set to 2min
screenshot: 'only-on-failure',
},
/* Configure projects for major browsers */
projects: [
{
name: 'Desktop - Chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'Desktop - Firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'Desktop - Webkit',
use: { ...devices['Desktop Safari'] },
},
],
});