-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
36 lines (33 loc) · 999 Bytes
/
Copy pathplaywright.config.ts
File metadata and controls
36 lines (33 loc) · 999 Bytes
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
import { defineConfig } from '@playwright/test';
import * as dotenvFlow from 'dotenv-flow';
import path from 'path';
// Load env variables before config is defined
dotenvFlow.config({
path: path.resolve(__dirname, 'env'),
node_env: process.env.TEST_ENV || 'local'
});
export default defineConfig({
testDir: './tests',
workers: 2,
retries: 1,
timeout: 30000,
reporter: [
['list'],
['allure-playwright'],
['json', { outputFile: 'playwright-report/test-results.json' }]
],
use: {
baseURL: process.env.BASE_URL || 'https://example.com',
headless: false,
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'on-first-retry',
},
projects: [
{ name: 'Chromium', use: { browserName: 'chromium' } },
{ name: 'Firefox', use: { browserName: 'firefox' } },
{ name: 'WebKit', use: { browserName: 'webkit' } }
],
globalSetup: require.resolve('./global/setup.ts'),
globalTeardown: require.resolve('./global/teardown.ts'),
});