forked from mdn/fred
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwdio.conf.js
More file actions
43 lines (42 loc) · 972 Bytes
/
wdio.conf.js
File metadata and controls
43 lines (42 loc) · 972 Bytes
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
const FRED_PORT = process.env.FRED_PORT || "3000";
/** @type {WebdriverIO.Config} */
export const config = {
runner: "local",
specs: ["./test/specs/**/*.js"],
maxInstances: 10,
capabilities: [
{
browserName: "firefox",
"moz:firefoxOptions": {
args: ["-headless"],
},
},
],
logLevel: "error",
framework: "mocha",
reporters: ["spec"],
mochaOpts: {
ui: "bdd",
timeout: 60_000,
},
baseUrl: `http://localhost:${FRED_PORT}/`,
async before(_, __, browser) {
console.log("waiting for servers to start");
await browser.waitUntil(
async () => {
try {
await browser.url(`http://localhost:${FRED_PORT}`);
await browser.url("http://localhost:8083");
return true;
} catch {
return false;
}
},
{
timeout: 30_000,
timeoutMsg: "Server not available after 30 seconds",
interval: 1000,
},
);
},
};