-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwdio.conf.js
More file actions
71 lines (69 loc) · 1.66 KB
/
wdio.conf.js
File metadata and controls
71 lines (69 loc) · 1.66 KB
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
exports.config = {
runner: "local",
specs: ["./test.spec.js"],
exclude: [],
maxInstances: 10,
capabilities: [
{
maxInstances: 1,
browserName: "chrome",
acceptInsecureCerts: true,
// "goog:chromeOptions": {
// args: ["--headless", "--disable-gpu"]
// }
}
],
logLevel: "error",
bail: 0,
baseUrl: "http://localhost",
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: ["chromedriver"],
framework: "mocha",
reporters: [
"spec",
[
"allure",
{
outputDir: "allure-results"
}
]
],
mochaOpts: {
require: ["@babel/register"],
ui: "bdd",
timeout: 50000
},
afterTest: function (
test,
context,
{ error, result, duration, passed, retries }
) {
if (!passed) {
browser.takeScreenshot();
}
},
onComplete: function () {
const fs = require("fs-extra");
fs.mkdir("./allure-results/history", { recursive: true }, (err) => {
if (err) throw err;
});
if (fs.existsSync("./allure-report/history")) {
fs.copySync("./allure-report/history", "./allure-results/history");
}
const allure = require("allure-commandline");
const reportError = new Error("Could not generate Allure report");
const generation = allure(["generate", "allure-results", "--clean"]);
return new Promise((resolve, reject) => {
generation.on("exit", function (exitCode) {
if (exitCode !== 0) {
return reject(reportError);
}
fs.removeSync("./allure-results");
console.log("Allure report successfully generated");
resolve();
});
});
}
};