-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
68 lines (58 loc) · 1.49 KB
/
playwright.config.ts
File metadata and controls
68 lines (58 loc) · 1.49 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
import type { PlaywrightTestConfig } from '@playwright/test';
import path from 'node:path';
/**
* Get the project root directory path
* @returns Absolute path to the project root
*/
function getProjectRoot(): string {
// This path should point to the root of maidr-ts project
// where the examples directory is located
// __dirname will be the root folder now
return __dirname;
}
/**
* Configuration for Playwright tests
* Includes settings for test execution, browser configuration, and reporting
*/
const config: PlaywrightTestConfig = {
// Set the test directory to match your project structure
testDir: path.join(__dirname, 'test/e2e/specs'),
// Test file pattern - include both spec.ts patterns
testMatch: '**/*.spec.ts',
// Set timeout values
timeout: 30000,
expect: {
timeout: 5000,
},
// Test reporters
reporter: [
['html', { open: 'never' }],
['list'],
],
// Shared settings for all projects
use: {
// Use file protocol with absolute path to project root
baseURL: `file://${getProjectRoot()}/`,
// Browser settings
viewport: null,
// Capture traces and screenshots on failure
trace: 'on',
screenshot: 'only-on-failure',
},
// Configure browsers to test in
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' },
},
{
name: 'firefox',
use: { browserName: 'firefox' },
},
{
name: 'webkit',
use: { browserName: 'webkit' },
},
],
};
export default config;