-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
65 lines (58 loc) · 1.75 KB
/
Copy pathplaywright.config.ts
File metadata and controls
65 lines (58 loc) · 1.75 KB
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
import { defineConfig, devices } from '@playwright/test';
import { defineBddConfig } from 'playwright-bdd';
import dotenv from 'dotenv';
dotenv.config({ quiet: true });
//Note: The baseURL is set to the value of PLAYWRIGHT_BASE_URL from the .env file if it exists, otherwise it defaults to http://localhost:${port}.
const port = Number(process.env.PLAYWRIGHT_PORT || 8080);
const baseURL = process.env.PLAYWRIGHT_BASE_URL || `http://localhost:${port}`;
const testDir = defineBddConfig({
features: 'e2e-tests/features/**/*.feature',
steps: [
'e2e-tests/steps/**/*.step.ts',
'e2e-tests/fixture/fixtures.ts',
],
outputDir: '.features-gen',
});
export default defineConfig({
testDir,
timeout: 30000,
expect: {
timeout: 6000,
},
fullyParallel: true,
workers: process.env.CI ? 2 : 1,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
reporter: [['html', { open: 'never' }], ['list']],
use: {
baseURL,
viewport: null,
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'on-first-retry',
headless: !!process.env.CI,
},
webServer: process.env.PLAYWRIGHT_BASE_URL
? undefined
: {
command: 'yarn start:dev',
port,
reuseExistingServer: !process.env.CI,
timeout: 120_000
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
// use: { ...devices['Desktop Chrome'],
use: {
browserName: 'chromium',
launchOptions: {
args: ['--start-maximized'],
},
video: 'on-first-retry', //Options => 'on', 'off', 'retain-on-failure' or 'on-first-retry'
screenshot: 'only-on-failure', //Options => 'on', 'off', 'only-on-failure' or 'on-first-retry'
},
},
],
});