|
1 | | -import fs from "node:fs/promises"; |
2 | 1 | import path from "node:path"; |
| 2 | +import { getWdioConfig } from "../utils"; |
3 | 3 | import type { Options } from "@wdio/types"; |
4 | 4 |
|
5 | | -const extensionPath = process.env.VSCODE_E2E_EXTENSION_PATH ?? process.cwd(); |
6 | | -const workspacePath = path.resolve(process.cwd(), process.env.VSCODE_E2E_WORKSPACE_PATH || "samples/settings-view"); |
7 | | - |
8 | | -export const config: Options.Testrunner = { |
9 | | - runner: "local", |
10 | | - specs: ["./specs/**/*.ts"], |
11 | | - maxInstances: 1, |
12 | | - capabilities: [ |
13 | | - { |
14 | | - browserName: "vscode", |
15 | | - browserVersion: process.env.VSCODE_VERSION || "stable", |
16 | | - "wdio:vscodeOptions": { |
17 | | - extensionPath, |
18 | | - workspacePath, |
19 | | - userSettings: { |
20 | | - "npm.packageManager": "npm", |
21 | | - "git.openRepositoryInParentFolders": "never", |
22 | | - }, |
23 | | - }, |
24 | | - }, |
25 | | - ], |
26 | | - logLevel: "info", |
27 | | - waitforTimeout: 10000, |
28 | | - connectionRetryTimeout: 120000, |
29 | | - connectionRetryCount: 0, |
30 | | - specFileRetries: process.env.RUN_IN_CI ? 1 : 0, |
31 | | - services: ["vscode"], |
32 | | - framework: "mocha", |
33 | | - reporters: ["spec"], |
34 | | - mochaOpts: { |
35 | | - ui: "bdd", |
36 | | - timeout: 60000, |
37 | | - }, |
38 | | - afterTest: async (test, _, { passed }) => { |
39 | | - if (passed) { |
40 | | - return; |
41 | | - } |
42 | | - |
43 | | - const screenshotDir = path.join(__dirname, "..", "screens-on-fail"); |
44 | | - await fs.mkdir(screenshotDir, { recursive: true }); |
45 | | - await browser.saveScreenshot(path.join(screenshotDir, `${test.parent} - ${test.title}.png`)); |
46 | | - }, |
47 | | -}; |
| 5 | +export const config: Options.Testrunner = getWdioConfig({ |
| 6 | + extensionPath: process.cwd(), |
| 7 | + workspacePath: path.resolve(process.cwd(), "samples/settings-view"), |
| 8 | +}); |
0 commit comments