garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.71k stars 603 forks source link

Unable to use approve button #1543

Open kartheekgj opened 7 months ago

kartheekgj commented 7 months ago

Hi,

i followed the steps provided in the documentation to add the approve button in the interactive web reporting but unfortunately i could not see the button comming up. I see backstop remote running sucessfully but when i open http|https://127.0.0.1:3000 donot show the report. I tried running the backstop using backstop test and when i run the backstop openreport it says its not open to public. When i open the backstop remote it says its rendered but not opening anything. Also where can i change this port number 3000 to anything else. I couldnot find this in the documentation anywhere. Can you provide an example where the approve/reject button is implemented I can see this has been added somewhere here https://github.com/garris/BackstopJS/blob/master/remote/index.js But how to enable this or should we add this as a button and then do the call from the report?

freesh commented 1 month ago

To see the Button you can add "?remote" to the reports uri. The WebApp is just searching the uri path for 'remote' to show the button.

I you're trying to use the remote command directly from code with something like this:

await backstop('remote', {
      config: {
        ...config,
        "paths": {
          "bitmaps_reference": `backstop_data_${projectName}/bitmaps_reference`,
          "bitmaps_test": `backstop_data_${projectName}/bitmaps_test`,
          "engine_scripts": `backstop_scripts/${projectName}`,
          "html_report": `backstop_data_${projectName}/html_report`,
          "ci_report": `backstop_data_${projectName}/ci_report`
        },

Be aware that your path and most of the other config will be ignored. The remote command starts a middleware with exec and the dynamic config gets lost at this point. :-/

But in my opinion i might not a big problem to build an own remote approve service for this.