-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
51 lines (45 loc) · 1.29 KB
/
Copy pathplaywright.config.ts
File metadata and controls
51 lines (45 loc) · 1.29 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
import { defineConfig } from '@playwright/test';
import { configManager } from './src/config/ConfigManager';
export default defineConfig({
testDir: './tests',
// Global setup/teardown — wired to the observability layer.
// setup : resets MetricsCollector so each run starts clean
// teardown: prints API metrics summary + FailureAnalyzer diagnostics
globalSetup: './src/config/global-setup',
globalTeardown: './src/config/global-teardown',
// Limit workers to 2 to avoid hitting DummyJSON's rate limiter (429).
// DummyJSON is a public free API — running too many parallel logins triggers
// "request limit exceeded". 2 workers is a safe balance of speed vs. rate limits.
fullyParallel: true,
workers: 2,
retries: process.env.CI ? 2 : 1,
use: {
baseURL: configManager.getBaseUrl(),
},
projects: [
{
name: 'smoke',
grep: /@smoke/,
retries: 1,
},
{
name: 'integration',
grep: /@integration/,
retries: 1,
},
{
name: 'contract',
grep: /@contract/,
retries: 1,
},
{
name: 'all',
retries: process.env.CI ? 2 : 1,
},
],
reporter: [
['html', { outputFolder: 'playwright-report', open: 'never' }],
['json', { outputFile: 'reports/results.json' }],
['list'],
],
});