-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.log.ts
More file actions
37 lines (32 loc) · 875 Bytes
/
Copy pathplaywright.config.log.ts
File metadata and controls
37 lines (32 loc) · 875 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
37
import path from "node:path";
import { defineConfig, devices } from "@playwright/test";
// Re-use the same base URL logic
const PORT = process.env.PORT || 3000;
const baseURL = `http://localhost:${PORT}`;
// This is the config for tests that need server logs
export default defineConfig({
timeout: 30 * 1000,
// Point to the directory with tests that need logs
testDir: path.join(__dirname, "tests-log"),
retries: 2,
outputDir: "test-results/",
// The only difference is here: stdout is set to 'pipe'
webServer: {
command: "pnpm dev:test",
url: baseURL,
stdout: "pipe",
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
},
use: {
baseURL,
trace: "retry-with-trace",
},
// You can specify a subset of browsers for these tests if you want
projects: [
{
name: "Desktop Chrome",
use: { ...devices["Desktop Chrome"] },
},
],
});