mlison / protractor-jasmine2-screenshot-reporter

Protractor screenshot reporter for Jasmine2
https://www.npmjs.com/package/protractor-jasmine2-screenshot-reporter
MIT License
81 stars 79 forks source link

No screenshots are generated when restartProtractorBetweenTests is set to true #83

Closed ActualAl closed 7 years ago

ActualAl commented 7 years ago

When restartBrowserBetweenTests is set to true in my protractor conf - the reporter doesn't generate screen shots with the report.

I've attached a screen shot of the report generated.

screensnot

The protractor conf is as follows

`import * as HtmlScreenshotReporter from "protractor-jasmine2-screenshot-reporter";

let screenshotReporter = new HtmlScreenshotReporter({ dest: "./protractor-tests/screenshots", filename: "screenshot_reports_e2e.html" });

export let config = { allScriptsTimeout: 30000, baseUrl: "http://localhost:9001", restartBrowserBetweenTests: true, framework: "jasmine2", specs: [ "./*/steps.js" ], capabilities: { browserName: "chrome", "chromeOptions": { args: ["--test-type", "--no-sandbox"] } }, beforeLaunch: function() { return new Promise(function(resolve){ screenshotReporter.beforeLaunch(resolve); }); }, afterLaunch: function(exitCode) { return new Promise(function(resolve){ screenshotReporter.afterLaunch(resolve.bind(this, exitCode)); }); }, jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 100000 }, onPrepare: function () { // Set up Jasmine Reporters jasmine.getEnv().addReporter(screenshotReporter); let reporters = require("jasmine-reporters"); if (process.env.TEAMCITY_VERSION) { jasmine.getEnv().addReporter(new reporters.TeamCityReporter()); } else { jasmine.getEnv().addReporter(new reporters.TerminalReporter({ verbosity: 3, showStack: true })); } } }; `

mlison commented 7 years ago

Yes I'm afraid this is a limitation on Jasmine's side. specDone is a synchronous command so nothing will wait for it - this remains to be an unsolved flaw that keeps causing trouble in various projects, and I'm afraid there's not much we can do with it on our end.