-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
76 lines (71 loc) · 1.87 KB
/
playwright.config.ts
File metadata and controls
76 lines (71 loc) · 1.87 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
66
67
68
69
70
71
72
73
74
75
76
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
dotenv.config();
const isCI = !!process.env.CI;
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 3 : 1,
workers: isCI ? 4 : 4,
timeout: 60_000,
reporter: [
['html', { outputFolder: 'playwright-report', open: 'never' }],
['json', { outputFile: 'playwright-report/result.json' }],
isCI ? ['dot'] : ['list'],
],
outputDir: 'test-results',
use: {
baseURL: process.env.E2E_BASE_URL || process.env.WP_BASE_URL || 'http://localhost:8080',
screenshot: 'only-on-failure',
trace: 'on-first-retry',
headless: true,
},
projects: [
// Auth setup (JS — tester's suite)
{
name: 'setup',
testMatch: /auth\.setup\.js/,
},
// Auth setup (TS — original suite)
{
name: 'setup-ts',
testMatch: /global-setup\.ts/,
},
// Classic Editor tests
{
name: 'classic',
testDir: './tests/e2e/classic',
use: { ...devices['Desktop Chrome'], storageState: 'playwright/.auth/user.json' },
dependencies: ['setup'],
},
// Gutenberg tests
{
name: 'gutenberg',
testDir: './tests/e2e/gutenberg',
use: { ...devices['Desktop Chrome'], storageState: 'playwright/.auth/user.json' },
dependencies: ['setup'],
},
// Elementor tests
{
name: 'elementor',
testDir: './tests/e2e/elementor',
use: { ...devices['Desktop Chrome'], storageState: 'playwright/.auth/user.json' },
dependencies: ['setup'],
},
// Dashboard tests
{
name: 'dashboard',
testDir: './tests/e2e/dashboard',
use: { ...devices['Desktop Chrome'], storageState: 'playwright/.auth/user.json' },
dependencies: ['setup'],
},
// Original TS e2e tests (local Docker)
{
name: 'e2e',
testMatch: /.*\.spec\.ts/,
use: { storageState: 'tests/e2e/.auth/wp-session.json' },
dependencies: ['setup-ts'],
},
],
});