-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwdio.conf.js
42 lines (40 loc) · 1.04 KB
/
wdio.conf.js
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
const express = require("express");
const { URL } = require("url");
let server = null;
module.exports.config = {
runner: "local",
specs: ["./test/sanity.test.js", "./test/**/*.test.js"],
maxInstances: 1,
capabilities: [
{
browserName: "chrome",
"goog:chromeOptions": {
args: ["--headless", "--disable-gpu"],
},
},
],
logLevel: "error",
bail: 0,
baseUrl: "http://localhost:8080",
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
framework: "mocha",
reporters: ["spec"],
mochaOpts: {
ui: "bdd",
timeout: 60000,
},
onPrepare: async function (config) {
const url = new URL(config.baseUrl);
const port = url.port ? url.port : url.protocol === "https" ? 443 : 80;
await new Promise((resolve, reject) => {
const app = express();
app.use(express.static("dist"));
server = app.listen(port, resolve).on("error", reject);
});
},
onComplete: async function () {
await new Promise((resolve) => server.close(resolve));
},
};