Open JefferE opened 8 years ago
This trick seems to work for me:
jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
savePath : 'reports//',
screenshotsFolder : 'screenshots',
takeScreenshots : true,
takeScreenshotsOnlyOnFailures: false,
filePrefix : 'protractor_report'
}));
Adding a single trailing slash to 'savePath' value worked for me having the same issue on OSX:
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'testing/reports/'
})
);
I tried @scoobster17 solution and it works for me on Windows. Thanks!
On windows I had to change:
screenshotPath = path.join(self.savePath + self.screenshotsFolder, spec.screenshot);
To:
screenshotPath = path.join(self.savePath + "/" + self.screenshotsFolder, spec.screenshot);
Adding the slash between the sections or it was generating these folders:
reports reportsscreenshots
and so the html report was not finding the screenshots it was trying to link as:
src="screenshots/b8e6751cb2a4e1cb1b9ea09ac1d0ef5f.png"
This is my config:
If I tried setting this instead:
Then it tries to link to:
src="/screenshots/b8e6751cb2a4e1cb1b9ea09ac1d0ef5f.png"
But the created folder is still:reportsscreenshots
Because this line is stripping the leading slash:
self.screenshotsFolder = (options.screenshotsFolder || 'screenshots').replace(/^\//, '') + '/';