Skip to content
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

Infinite loop "closing report" when using property cleanDestination: false #126

Open
Garcia-JuanLuis opened this issue Jul 29, 2020 · 0 comments

Comments

@Garcia-JuanLuis
Copy link

When this property is specified, it appears the very first time a test suite runs, the framework runs into an infinite loop. All I see is the continued error "closing report" getting logged to the console. A normal build at my current job, for the sytem under test, takes about 20 minutes; however, when I made this change, it took over 2hrs, and I had to abort it.
The configuration:

let HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
let htmlScreenshotReporter = new HtmlScreenshotReporter({
dest: 'reports/screenshots',
filename: 'e2e-screenshots.html',
captureOnlyFailedSpecs: true,
reportOnlyFailedSpecs: false,
cleanDestination: false,
reportTitle: "End-To-End Test Results"
})

onPrepare() {
// Assign the test reporter to each running instance
jasmine.getEnv().addReporter(htmlScreenshotReporter);
}

// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
htmlScreenshotReporter.beforeLaunch(resolve);

  //By default, no report is generated if an exception is thrown from within the test run. We can, however, catch these errors and make jasmine report current spec explicitly, with the following code.
  process.on('uncaughtException', function () {
    htmlScreenshotReporter.jasmineDone();
    htmlScreenshotReporter.afterLaunch();
  });
});

}

// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
htmlScreenshotReporter.afterLaunch(resolve.bind(this, exitCode));
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant