-
Notifications
You must be signed in to change notification settings - Fork 28
/
cucumber.conf.js
43 lines (38 loc) · 959 Bytes
/
cucumber.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
const fs = require('fs');
const path = require('path');
const { setDefaultTimeout, After, AfterAll, BeforeAll } = require('cucumber');
const {
createSession,
closeSession,
startWebDriver,
stopWebDriver,
getNewScreenshots,
} = require('nightwatch-api');
const reporter = require('cucumber-html-reporter');
setDefaultTimeout(60000);
BeforeAll(async () => {
await startWebDriver({});
await createSession({});
});
AfterAll(async () => {
await closeSession();
await stopWebDriver();
setTimeout(() => {
reporter.generate({
theme: 'bootstrap',
jsonFile: 'report/cucumber_report.json',
output: 'report/cucumber_report.html',
reportSuiteAsScenarios: true,
launchReport: true,
metadata: {
'App Version': '0.3.2',
'Test Environment': 'POC',
}
});
}, 0);
});
After(function() {
getNewScreenshots().forEach(file =>
this.attach(fs.readFileSync(file), 'image/png'),
);
});