Skip to content

Commit 44ef8db

Browse files
committed
chore: refactor wdio.conf and tsconfig
1 parent 46dd1fa commit 44ef8db

4 files changed

Lines changed: 12 additions & 116 deletions

File tree

tests/e2e/basic/tsconfig.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
{
2-
"compilerOptions": {
3-
"lib": ["es2022", "dom"],
4-
"types": ["node", "@wdio/globals/types", "expect-webdriverio", "@wdio/mocha-framework", "wdio-vscode-service"],
5-
"esModuleInterop": true,
6-
"skipLibCheck": true,
7-
"noEmit": true,
8-
"allowImportingTsExtensions": true,
9-
"resolveJsonModule": true,
10-
"isolatedModules": true,
11-
"strict": true,
12-
"noUnusedLocals": true,
13-
"noUnusedParameters": true,
14-
"noFallthroughCasesInSwitch": true
15-
},
2+
"extends": "../tsconfig.common.json",
163
"include": ["specs", "wdio.conf.ts"]
174
}

tests/e2e/basic/wdio.conf.ts

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
1-
import fs from "node:fs/promises";
21
import path from "node:path";
2+
import { getWdioConfig } from "../utils";
33
import type { Options } from "@wdio/types";
44

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/basic");
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/basic"),
8+
});
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
{
2-
"compilerOptions": {
3-
"lib": ["es2022", "dom"],
4-
"types": ["node", "@wdio/globals/types", "expect-webdriverio", "@wdio/mocha-framework", "wdio-vscode-service"],
5-
"esModuleInterop": true,
6-
"skipLibCheck": true,
7-
"noEmit": true,
8-
"allowImportingTsExtensions": true,
9-
"resolveJsonModule": true,
10-
"isolatedModules": true,
11-
"strict": true,
12-
"noUnusedLocals": true,
13-
"noUnusedParameters": true,
14-
"noFallthroughCasesInSwitch": true
15-
},
2+
"extends": "../tsconfig.common.json",
163
"include": ["specs", "wdio.conf.ts"]
174
}
Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
1-
import fs from "node:fs/promises";
21
import path from "node:path";
2+
import { getWdioConfig } from "../utils";
33
import type { Options } from "@wdio/types";
44

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

Comments
 (0)