-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathglobals.js
More file actions
executable file
·36 lines (34 loc) · 891 Bytes
/
Copy pathglobals.js
File metadata and controls
executable file
·36 lines (34 loc) · 891 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
const HtmlReporter = require('nightwatch-html-reporter');
const reporter = new HtmlReporter({
openBrowser: true,
reportsDirectory: __dirname + '/reports',
uniqueFilename: true, // 測試報告是否要加上 timestamp
separateReportPerSuite: true, // 測試報告是否要加上 test suite 的名稱
themeName: 'cover'
});
module.exports = {
reporter: reporter.fn,
before: function(done) {
process.argv.forEach(string => {
let key = string.replace(/^--(.*)=.*/, '$1');
let value = string.replace(/^--.*=(.*)/, '$1');
switch (key) {
case 'rtEnv':
case 'userName':
case 'customTag':
this.rtContext[key] = value;
break;
}
});
done();
},
after: function(done) {
done();
},
beforeEach: function(browser, done) {
done();
},
afterEach: function(browser, done) {
done();
}
};