Skip to content
Snippets Groups Projects
Commit 405d9eb0 authored by Alexandre Ducarne's avatar Alexandre Ducarne
Browse files

Improved Spec reporter

parent 65b11f0d
No related branches found
No related tags found
2 merge requests!5Develop,!4Improved Spec reporter
{
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ const path = require('path'); ...@@ -4,7 +4,7 @@ const path = require('path');
exports.config = { exports.config = {
allScriptsTimeout: 11000, allScriptsTimeout: 11000,
// seleniumAddress: 'http://localhost:4444/wd/hub' //seleniumAddress: 'http://localhost:4444/wd/hub',
// The port to start the selenium server on, or null if the server should // The port to start the selenium server on, or null if the server should
// find its own unused port. // find its own unused port.
...@@ -30,9 +30,11 @@ exports.config = { ...@@ -30,9 +30,11 @@ exports.config = {
framework: 'jasmine', framework: 'jasmine',
onPrepare: function() { onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
// Add a screenshot reporter: // Add a screenshot reporter:
jasmine.getEnv().addReporter(new HtmlReporter({ jasmine.getEnv().addReporter(new HtmlReporter({
preserveDirectory: false, preserveDirectory: true,
takeScreenShotsOnlyForFailedSpecs: true, takeScreenShotsOnlyForFailedSpecs: true,
screenshotsSubfolder: 'images', screenshotsSubfolder: 'images',
jsonsSubfolder: 'jsons', jsonsSubfolder: 'jsons',
...@@ -47,13 +49,14 @@ exports.config = { ...@@ -47,13 +49,14 @@ exports.config = {
const day = currentDate.getDate(); const day = currentDate.getDate();
const month = currentDate.getMonth() + 1; const month = currentDate.getMonth() + 1;
const year = currentDate.getFullYear(); const year = currentDate.getFullYear();
const time = currentDate.getHours() + ':' + currentDate.getMinutes() + '-' + currentDate.getSeconds();
const validDescriptions = descriptions.map(function(description) { const validDescriptions = descriptions.map(function(description) {
return description.replace('/', '@'); return description.replace('/', '@');
}); });
return path.join( return path.join(
day + '-' + month + '-' + year, day + '-' + month + '-' + year +'-'+ time,
validDescriptions.join('-')); validDescriptions.join('-'));
}, },
}).getJasmine2Reporter()); }).getJasmine2Reporter());
...@@ -64,7 +67,4 @@ exports.config = { ...@@ -64,7 +67,4 @@ exports.config = {
defaultTimeoutInterval: 30000, defaultTimeoutInterval: 30000,
print: function() {}, print: function() {},
}, },
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
},
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment