Closed ybc9959 closed 4 years ago
Attaching Code below.
onPrepare: function() {
// Add a screenshot reporter and store screenshots to /tmp/screenshots
:
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: 'tmp/screenshots',
docName: 'index.html',
docTitle: 'my reporter',
takeScreenShotsOnlyForFailedSpecs: true,
excludeSkippedSpecs: true,
preserveDirectory: false,
gatherBrowserLogs: false,
sortFunction: function sortFunction(a, b) {
if (a.cachedBase === undefined) {
var aTemp = a.description.split('|').reverse();
a.cachedBase = aTemp.slice(0).slice(0, -1);
a.cachedName = aTemp.slice(0).join('');
};
if (b.cachedBase === undefined) {
var bTemp = b.description.split('|').reverse();
b.cachedBase = bTemp.slice(0).slice(0, -1);
b.cachedName = bTemp.slice(0).join('');
};
var firstBase = a.cachedBase;
var secondBase = b.cachedBase;
for (var i = 0; i < firstBase.length || i < secondBase.length; i++) {
if (firstBase[i] === undefined) { return -1; }
if (secondBase[i] === undefined) { return 1; }
if (firstBase[i].localeCompare(secondBase[i]) === 0) { continue; }
return firstBase[i].localeCompare(secondBase[i]);
}
var firstTimestamp = a.timestamp;
var secondTimestamp = b.timestamp;
if (firstTimestamp < secondTimestamp) return -1;
else return 1;
},
clientDefaults: {
searchSettings: {
allselected: false,
passed: false,
failed: true,
pending: true,
withLog: true
},
columnSettings: {
displayTime: true,
displayBrowser: true,
displaySessionId: false,
displayOS: true,
inlineScreenshots: false
},
showTotalDurationIn: "header",
totalDurationFormat: "hms",
}
}).getJasmine2Reporter());
},
@ybc9959 Thank you for reporting this issue
Could you please specify which version of the reporter you are using.
Also If you could run your build pipeline with variable system.debug=true
to confirm that screenshot have been uploaded. You should see
Attached copy of the task execution log.txt
Package dependency globby stopped supporting windows slashes with the release of version 10.x. You can read details here
https://github.com/sindresorhus/globby/issues/130
Updating upload path to replace windows slashes with unix ones.
Please find the attached Logs & Version
@ybc9959 Bear in mind that extension task looks for combined.json file in root directory of your report and then it searches for screenshots in screenshots subdirectory.
Please try adding following line to your reporter configuration
screenshotsSubfolder: 'screenshots',
Yeah I see that the task is looking for Combined.json file.
Protractor Beautiful Reporter is working fine and I was able to see all the screenshots and index.html file in temp folder. When I open the Index.html folder from my local, I was able to see the Report with failed screenshots and all the Logs what I expected. Now I configured same thing in Azure Devops , Everything is Displaying well except the screenshots. When I click on the image it was blank, checked locally and html report works fine. Attaching some screenshots.