generated from HotTesting/9-js-ui-wdio
-
Notifications
You must be signed in to change notification settings - Fork 12
/
wdio.conf.js
executable file
·72 lines (67 loc) · 1.79 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require("ts-node").register({ files: true });
const wdioConfig = {
runner: "local",
specs: ["./test/specs/**/*.ts"],
capabilities: [
{
maxInstances: 2,
browserName: "chrome"
}
],
// capabilities: {
// user1: {
// capabilities: {
// browserName: "chrome"
// }
// },
// user2: {
// capabilities: {
// browserName: "chrome"
// }
// }
// },
baseUrl: process.env.SUT_URL || "http://ip-5236.sunline.net.ua:38015",
services: [],
framework: "mocha",
reporters: [
"spec",
[
"allure",
{
outputDir: "allure-results",
disableMochaHooks: true,
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: false
}
]
],
mochaOpts: {
ui: "bdd",
timeout: 60000
},
beforeSession: function(config, capabilities) {
if (process.env.DEBUG == "1") {
// Giving debugger some time to connect...
return new Promise(resolve => setTimeout(resolve, 5000));
}
},
afterTest: function(test) {
if (test.error !== undefined) {
browser.takeScreenshot();
}
}
};
if (process.env.SELENIUM_HUB_HOST) {
wdioConfig.hostname = process.env.SELENIUM_HUB_HOST
wdioConfig.port = 4444
wdioConfig.path = "/wd/hub"
} else {
wdioConfig.services = ["chromedriver"];
}
if (process.env.DEBUG == "1") {
console.log("###### Running in debug mode! ######");
wdioConfig.maxInstances = 1;
wdioConfig["execArgv"] = ["--inspect=127.0.0.1:5858"];
wdioConfig.mochaOpts.timeout = 360000;
}
exports.config = wdioConfig;