Evilweed / protractor-beautiful-reporter

An npm module which provides html reports of your Protractor tests with screenshots
MIT License
169 stars 40 forks source link

It is impossible to open screenshots in generated report by mouseClick(). #170

Closed zhukovsv closed 5 years ago

zhukovsv commented 5 years ago

Trying to open screenshots in report by mouseClick:

  1. "protractor-beautiful-reporter": "1.3.0"
  2. Google Chrome: Version 76.0.3809.132 (Official Build) (64-bit)
  3. Console error: image
  4. Error text: angular.min.js:110 Access to XMLHttpRequest at 'file:///C:/Users/.../Downloads/.../pbr-screenshot-modal.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

As I understand the problem appears after new functionality was added in 1.3.0 version. New functionality related to the next files: image

Problem disappears if version is reversed to 1.2.9.

Is it possible to find problem solution with new functionality added in 1.3.0?

Regards, Sergei.

miller45 commented 5 years ago

@zhukovsv First of all thank for the precise description :-) Update: It is fixed now...just use version 1.3.1 It think it did not test opening the files with from a local folder, but with a temporary web server. So i did not detect that it does not work when you open the report directly from file system. Chrome just blocks ajax request for file protocol, so the report cannot load the pbrmodal files if open directly from the files system. While I search for a solution you can do the following in the meantime:

miller45 commented 5 years ago

@zhukovsv I published the version 1.3.1 which fixes this issue

miller45 commented 5 years ago

Fixed in 1.3.1 and tested

zhukovsv commented 5 years ago

Thanks a lot. :-) 👍