-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
66 lines (64 loc) · 2.05 KB
/
playwright.config.js
File metadata and controls
66 lines (64 loc) · 2.05 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
// @ts-check
const { defineConfig } = require('@playwright/test');
// Test environment debug logging utility
// Uses console.log directly since this is test-time logging where console output is expected
const debugLog = (module, message, ...args) => {
// For test configuration, always log since it's test/development time
if (args.length > 0) {
console.log(`[${module}] ${message}`, ...args);
} else {
console.log(`[${module}] ${message}`);
}
};
/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: './tests',
/* Maximum time one test can run for. */
timeout: 10 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
*/
timeout: 5000
},
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests */
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: {
/* Collect trace when retrying the failed test */
trace: 'on-first-retry',
/* Immer im headless-Modus ausführen */
headless: true,
/* Browser-Größe für Konsistenz festlegen */
viewport: { width: 1280, height: 720 },
/* Screenshot-Ordner definieren */
screenshot: 'only-on-failure',
/* Video nur bei Fehlern aufzeichnen */
video: 'on-first-retry',
/* Collect browser console logs */
logger: {
isEnabled: (name, severity) => true,
log: (name, severity, message, args) => debugLog('PLAYWRIGHT_LOGGER', `${name} ${severity}: ${message}`)
},
},
},
],
/* Run your local dev server before starting the tests */
webServer: {
command: 'echo "Using existing dev server on port 9091"',
url: 'http://localhost:9091',
reuseExistingServer: true,
timeout: 5000,
},
});