-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.js
More file actions
76 lines (68 loc) · 1.83 KB
/
playwright.config.js
File metadata and controls
76 lines (68 loc) · 1.83 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
// @ts-check
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
// Load environment variables
dotenv.config();
const isCI = !!process.env.CI;
export default defineConfig({
testDir: './tests',
snapshotDir: './__screenshots__', // ✅ Baseline image storage
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 1 : 1, // Enable retries for flaky test behavior
workers: isCI ? 5 : 5,
timeout: 60 * 1000,
expect: {
timeout: 10 * 1000,
},
reporter: [
['html', {
outputFolder: 'playwright-report',
open: 'never'
}],
['blob', { outputDir: 'blob-report' }], // Blob reporter for merging
['json', { outputFile: './playwright-report/report.json' }],
['@testdino/playwright', { token: process.env.TESTDINO_TOKEN }],
],
use: {
baseURL: 'https://storedemo.testdino.com/products',
headless: true,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
actionTimeout: 15 * 1000,
navigationTimeout: 30 * 1000,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
grep: /@chromium/, // only run tests tagged @chromium
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
grep: /@firefox/, // only run tests tagged @firefox
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
grep: /@webkit/, // only run tests tagged @webkit
},
{
name: 'android',
use: { ...devices['Pixel 5'] },
grep: /@android/, // only run tests tagged @android
},
{
name: 'ios',
use: { ...devices['iPhone 12'] },
grep: /@ios/, // only run tests tagged @ios
},
{
name: 'api',
use: { ...devices['API'] },
grep: /@api/, // only run tests tagged @api
},
],
});