New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protractor fails if there were no screenshots taken with captureOnlyFailedSpecs #65
Comments
First of, extra internet points to you sir for the bug report, wish all of them would be like this. That said, I've tried following configuration with my test suite: var ScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var reporter = new ScreenshotReporter({
dest: 'reports/e2e/test',
filename: 'index.html',
ignoreSkippedSpecs: true,
reportOnlyFailedSpecs: false,
captureOnlyFailedSpecs: true
});
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['specs/test-spec.js'],
baseUrl: 'http://www.google.com/',
framework: 'jasmine',
capabilities: {
browserName: 'chrome'
},
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(reporter);
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
}; I've tried multiple combinations of failing and successful tests, but at worst the result is a directory with only index.html, where there's 0 specs / screenshots to be reported. Could you please elaborate on your setup? Maybe there's something specific in your suites that I need to replicate to get the same result. What environment are you running in? What's the node version? |
Having a similar problem with 0.3.2. The directory even gets created but the process still exists with an error. The setup is as simple as it gets: var htmlReporter = new HtmlScreenshotReporter({
dest: 'target/reports/html',
filename: 'report.html',
reportTitle: "E2E test report",
pathBuilder: function(currentSpec, suites, browserCapabilities) {
return browserCapabilities.get('browserName') + '/' + currentSpec.id;
}
});
|
Version: 0.3.0
Issue
Protractor run fails due to the reporter trying to create a screenshots index file when there are no screenshots taken. caputreOnlyFailedSpecs will always fail in a successful run unless the destination folder is created beforehand.
Expected behaviour
Since the normal behaviour for the reporter is to automatically create the folder, I'd expect it either not to create the file when there is nothing to report, or to create the folder before trying to write to it.
Debug info
Relevant protractor configuration
Protractor output:
The text was updated successfully, but these errors were encountered: