protractor-jasmine2-screenshot-reporter
Advanced tools
Comparing version 0.1.7 to 0.1.8
16
index.js
@@ -0,1 +1,3 @@ | ||
var DEFAULT_DESTINATION = 'target/screenshots'; | ||
var fs = require('fs'), | ||
@@ -153,5 +155,14 @@ mkdirp = require('mkdirp'), | ||
var getDestination = function(){ | ||
return (opts.dest || DEFAULT_DESTINATION) + '/'; | ||
}; | ||
var getDestinationWithUniqueDirectory = function(){ | ||
return getDestination() + hat() + '/'; | ||
}; | ||
// TODO: more options | ||
opts = opts || {}; | ||
opts.dest = (opts.dest || 'target/screenshots') + '/'; | ||
opts.preserveDirectory = opts.preserveDirectory || false; | ||
opts.dest = opts.preserveDirectory ? getDestinationWithUniqueDirectory() : getDestination(); | ||
opts.filename = opts.filename || 'report.html'; | ||
@@ -164,3 +175,2 @@ opts.ignoreSkippedSpecs = opts.ignoreSkippedSpecs || false; | ||
this.jasmineStarted = function() { | ||
@@ -305,3 +315,3 @@ mkdirp(opts.dest, function(err) { | ||
reason: printReasonsForFailure(spec), | ||
filename: encodeURIComponent(spec.filename), | ||
filename: encodeURI(spec.filename), | ||
duration: getDuration(spec), | ||
@@ -308,0 +318,0 @@ }); |
{ | ||
"name": "protractor-jasmine2-screenshot-reporter", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Use the screenshot reporter to capture screenshots after each executed Protractor test case.", | ||
@@ -43,2 +43,6 @@ "main": "index.js", | ||
"name": "Sandeep Adinarayana" | ||
}, | ||
{ | ||
"name": "Ievgenii Vdovenko", | ||
"email": "yevgenys2008@gmail.com" | ||
} | ||
@@ -45,0 +49,0 @@ ], |
@@ -104,1 +104,11 @@ ## Protractor screenshot reporter for Jasmine2 | ||
By default, the runner builder will not save any metadata except the actual html report. | ||
### Preserve Directory (optional) | ||
This option is __disabled by default__. When this option is enabled, than for each report will be | ||
created separate directory with unique name. Directory unique name will be generated randomly. | ||
<pre><code>jasmine.getEnv().addReporter(new HtmlScreenshotReporter({ | ||
preserveDirectory: true | ||
}));</code></pre> | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16651
6
294
114