-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
61 lines (57 loc) · 1.87 KB
/
playwright.config.ts
File metadata and controls
61 lines (57 loc) · 1.87 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
import { defineConfig } from "@playwright/test";
import { configDotenv } from "dotenv";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
configDotenv({
path: path.join(__dirname, "..", "..", ".env"),
});
const vscodeVersion = process.env.VSCODE_VERSION || "stable";
const WINDOWS_FACTOR = process.platform === "win32" ? 2 : 1;
export default defineConfig({
testDir: path.normalize(path.join(__dirname, "specs")),
forbidOnly: !!process.env.CI,
// maxFailures: 1, // uncomment for local dev/debugging purposes
retries: 2,
timeout: 120000,
workers: 1,
expect: {
// Windows may take 10sec+ just to start activating the extension, so it needs some extra time
// even when running tests locally
timeout: WINDOWS_FACTOR * (process.env.CI ? 60_000 : 30_000),
},
reporter: process.env.CI
? [
["list"],
// Generate blob reports for each test so they can be merged into a single per-job HTML
// report, including traces (see mk-files/semaphore.mk).
// (see https://playwright.dev/docs/test-reporters#blob-reporter)
["blob"],
[
"junit",
{
outputFile: path.normalize(path.join(__dirname, "..", "..", "TEST-result-e2e.xml")),
includeProjectInTestName: true,
suiteName: `VS Code (${vscodeVersion}) Extension Tests: E2E (${process.platform} ${process.arch})`,
},
],
]
: [["list"], ["html"]],
use: {
trace: "off", // manually configured in baseTest.ts
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "setup",
testMatch: "**/global.setup.ts",
testDir: path.join(__dirname),
},
{
name: `vscode-${vscodeVersion}`,
dependencies: ["setup"],
},
],
});