-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
42 lines (41 loc) · 1.23 KB
/
playwright.config.ts
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
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
forbidOnly: Boolean(process.env.CI),
fullyParallel: true,
globalTeardown: "./tests/globalTeardown.ts",
outputDir: "playwright/results/",
reporter: [
["list"],
[
"monocart-reporter",
{
name: "Monocart Report",
outputFile: "./playwright/results/report.html",
coverage: {
lcov: true,
reports: ["html", "lcov"],
entryFilter: (entry: { url: string }) =>
(entry.url.includes("next/static/chunks") ||
entry.url.includes("next/server/app")) &&
!entry.url.includes("node_modules"),
sourceFilter: (sourcePath: string) =>
sourcePath.includes("src/") && !sourcePath.includes("node_modules"),
sourcePath: (fileSource: string) => {
const list = ["_N_E/", "playwright-nextjs-coverage-example/"];
for (const pre of list) {
if (fileSource.startsWith(pre)) {
return fileSource.slice(pre.length);
}
}
return fileSource;
},
},
},
],
],
retries: process.env.CI ? 2 : 0,
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
testDir: "./tests",
use: { baseURL: "http://127.0.0.1:3000" },
workers: process.env.CI ? 1 : undefined,
});