-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf-html-reporter.js
63 lines (60 loc) · 1.87 KB
/
conf-html-reporter.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
exports.config = {
// seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['project_test.js'],
framework: 'jasmine2',
//allScriptsTimeout: 600000,
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=800x600"]
}
},
jasmineNodeOpts: {
defaultTimeoutInterval: 6000000
},
plugins: [{
package: 'jasmine2-protractor-utils',
disableHTMLReport: false,
disableScreenshot: false,
screenshotPath: './reports/screenshots',
screenshotOnExpectFailure: true,
screenshotOnSpecFailure: true,
clearFoldersBeforeTest: true,
htmlReportDir: './reports/htmlReports',
// failTestOnErrorLog: {
// failTestOnErrorLogLevel: 900,
// excludeKeywords: ['keyword1', 'keyword2']
// }
}],
onPrepare: function() {
browser.ignoreSynchronization = true
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './',
filePrefix: 'xmlresults'
}));
},
onComplete: function() {
var browserName, browserVersion;
var capsPromise = browser.getCapabilities();
capsPromise.then(function(caps) {
browserName = caps.get('browserName');
browserVersion = caps.get('version');
platform = caps.get('platform');
var HTMLReport = require('protractor-html-reporter-2');
testConfig = {
reportTitle: 'Protractor Test Execution Report',
outputPath: './',
outputFilename: 'ProtractorTestReport',
screenshotPath: './reports/screenshots',
testBrowser: browserName,
browserVersion: browserVersion,
modifiedSuiteName: true,
screenshotsOnlyOnFailure: true,
testPlatform: platform
};
new HTMLReport().from('xmlresults.xml', testConfig);
});
}
};