2024-07-08 12:27:29 +00:00
|
|
|
import type { Options, Services } from "@wdio/types";
|
|
|
|
|
|
|
|
const capabilities: WebdriverIO.Capabilities[] = [];
|
|
|
|
const services: Services.ServiceEntry[] = [];
|
|
|
|
|
|
|
|
const headless = process.argv.includes("--headless");
|
|
|
|
const chrome = process.argv.includes("--chrome");
|
2024-07-08 17:24:41 +00:00
|
|
|
const firefox = process.argv.includes("--firefox");
|
2024-07-08 18:11:24 +00:00
|
|
|
const edge = process.argv.includes("--edge");
|
2024-07-08 12:27:29 +00:00
|
|
|
|
|
|
|
if (chrome) {
|
|
|
|
const args = ["--disable-gpu"];
|
|
|
|
if (headless) {
|
|
|
|
args.push("--headless");
|
|
|
|
}
|
|
|
|
capabilities.push({
|
|
|
|
"wdio:maxInstances": 1,
|
|
|
|
browserName: "chrome",
|
|
|
|
"goog:chromeOptions": {
|
|
|
|
args,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
services.push("chromedriver");
|
|
|
|
}
|
|
|
|
|
2024-07-08 18:11:24 +00:00
|
|
|
if (edge) {
|
|
|
|
const args = ["--disable-gpu"];
|
|
|
|
if (headless) {
|
|
|
|
args.push("--headless");
|
|
|
|
}
|
|
|
|
capabilities.push({
|
|
|
|
"wdio:maxInstances": 1,
|
|
|
|
browserName: "MicrosoftEdge",
|
|
|
|
"ms:edgeOptions": {
|
|
|
|
args,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
services.push("edgedriver");
|
|
|
|
}
|
|
|
|
|
2024-07-08 17:24:41 +00:00
|
|
|
if (firefox) {
|
|
|
|
const args = [];
|
|
|
|
if (headless) {
|
|
|
|
args.push("-headless");
|
|
|
|
}
|
|
|
|
capabilities.push({
|
|
|
|
"wdio:maxInstances": 1,
|
|
|
|
browserName: "firefox",
|
|
|
|
"moz:firefoxOptions": {
|
|
|
|
args,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
services.push("geckodriver");
|
|
|
|
}
|
|
|
|
|
2024-07-08 12:27:29 +00:00
|
|
|
services.push([
|
|
|
|
"static-server",
|
|
|
|
{
|
|
|
|
folders: [
|
|
|
|
{ mount: "/dist", path: "./dist" },
|
|
|
|
{ mount: "/test_assets", path: "./test_assets" },
|
|
|
|
{ mount: "/test", path: "./test" },
|
|
|
|
],
|
|
|
|
port: 4567,
|
|
|
|
},
|
|
|
|
]);
|
2024-07-08 10:58:51 +00:00
|
|
|
|
|
|
|
export const config: Options.Testrunner = {
|
2020-05-23 09:43:22 +00:00
|
|
|
runner: "local",
|
2024-05-27 19:47:55 +00:00
|
|
|
specs: [
|
|
|
|
"./test/polyfill/**/test.ts",
|
|
|
|
"./test/js_api/*.ts",
|
|
|
|
"./test/integration_tests/**/test.ts",
|
|
|
|
],
|
2020-05-23 09:43:22 +00:00
|
|
|
maxInstances: 10,
|
2024-07-08 12:27:29 +00:00
|
|
|
capabilities,
|
2020-05-23 09:43:22 +00:00
|
|
|
logLevel: "info",
|
|
|
|
bail: 0,
|
|
|
|
baseUrl: "http://localhost",
|
2020-06-09 23:11:20 +00:00
|
|
|
waitforTimeout: 30000,
|
2020-05-23 09:43:22 +00:00
|
|
|
connectionRetryTimeout: 120000,
|
|
|
|
connectionRetryCount: 3,
|
2024-07-08 12:27:29 +00:00
|
|
|
services,
|
2020-05-23 09:43:22 +00:00
|
|
|
framework: "mocha",
|
|
|
|
reporters: ["spec"],
|
|
|
|
mochaOpts: {
|
|
|
|
ui: "bdd",
|
2022-04-25 20:38:16 +00:00
|
|
|
timeout: 120000,
|
2020-05-23 09:43:22 +00:00
|
|
|
},
|
|
|
|
};
|