maciejmaciejewski / azure-pipelines-protractor

Embed Protractor HTML report in Azure Pipelines
MIT License
3 stars 3 forks source link

Loading Screenshots cause a 404 and could not be displayed #13

Open omid1234 opened 4 years ago

omid1234 commented 4 years ago

Error Description: If there is an error in the test, screenshot will be taken and stored in the defined folder. So far so good, but it could not be displayed in the report tab in azure build. In the execution in the IDE i could see screenshots and inline screenshots from the app. After looking in the dev tools from Chrome, i could see that the image could not be found, there is a HTTP 404

@maciejmaciejewski Could you please provide support? That would be awesome :)

image

Code Snippet (config from protractor.config.json):

    jasmine.getEnv().addReporter(
      new HtmlReporter({
        baseDirectory: 'e2e/reports',
        screenshotsSubfolder: 'image',
        jsonsSubfolder: 'jsons',
        gatherBrowserLogs: true,
        preserveDirectory: false
      }).getJasmine2Reporter()
    );
omid1234 commented 4 years ago

Additionaly providing the destination address of the images that could noct been found:

https://maciejmaciejewski.gallerycdn.vsassets.io/extensions/maciejmaciejewski/azure-pipelines-protractor/1.1.1/1587387961180/dist/image\0095004e-008e-00e5-00a3-00e100e6001f.png

of course differs from local exec in ide:

file:///C:/dev/e2e/reports/image\000c00d6-00c6-00c8-00c1-002f001a0018.png where it works perfectly fine

maciejmaciejewski commented 4 years ago

Hey @omid1234 and sorry for late response, I have noticed that the address with gallerycdn is wrongly used when images are misconfigured. Could you please change screenshotsSubfolder from image dir to screenshots

PandharinathJadhav-Wellsky commented 4 years ago

Hi @maciejmaciejewski - Same issue for me , not able to view screenshot image on azure pipeline. so changing screenshotsSubfolder from image dir to screenshots will resolve the issue? my configuration baseDirectory: 'e2e_report/chrome', screenshotsSubfolder: 'images',

maciejmaciejewski commented 4 years ago

@PandharinathJadhav-Wellsky Yes, the reporting tool is expecting screenshots to be within the screenshots dir.

PandharinathJadhav-Wellsky commented 4 years ago

@PandharinathJadhav-Wellsky Yes, the reporting tool is expecting screenshots to be within the screenshots dir.

@maciejmaciejewski I changed the screenshotsSubfolder: 'screenshots', now its failing to load the report in azure with below error on console image

maciejmaciejewski commented 4 years ago

So screenshots are loading but there is some fishy with them, I will add some logging capability for easier debugging. In the meantime can you provide task logs with system.debug variable set to true?

PandharinathJadhav-Wellsky commented 4 years ago

So screenshots are loading but there is some fishy with them, I will add some logging capability for easier debugging. In the meantime can you provide task logs with system.debug variable set to true?

No, now report its not loading it self. image

maciejmaciejewski commented 4 years ago

What I meant is that you can see in the logs that extension is getting the list of attachments but cannot load them into the report. I will add more debugging option for easier troubleshooting.

maciejmaciejewski commented 4 years ago

@PandharinathJadhav-Wellsky I have added more logs so you can have a look at the browser.

maciejmaciejewski commented 3 years ago

@PandharinathJadhav-Wellsky I have learned that https://maciejmaciejewski.gallerycdn.vsassets.io/extensions/maciejmaciejewski/azure-pipelines-protractor/1.1.1/1587387961180/dist/image is used as a base path to the extension and appended to urls when you have no screenshot attachments uploaded correctly.

Could you please look at the task logs run it with system.debug=true and get back to me with results.