garris / BackstopJS

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

Reference image not found _0__0_ vs _0_document_0_ #1412

Open loopy3025 opened 2 years ago

loopy3025 commented 2 years ago

I've got a test that is, for some reason, looking for the wrong reference file. The scenario is callled "media center" and when I run backstop reference --filter="media center", it generates the files as expected.

backstop_default_media_center_0_document_0_mobile.png backstop_default_media_center_0_document_1_tablet.png backstop_default_media_center_0_document_2_desktop.png backstop_default_media_center_0_document_3_wide.png

But when I run backstop test --filter="media center", I get the following response:

Puppeteer encountered an error while running scenario "media center" TimeoutError: Navigation timeout of 60000 ms exceeded Puppeteer encountered an error while running scenario "media center" TimeoutError: Navigation timeout of 60000 ms exceeded Puppeteer encountered an error while running scenario "media center" TimeoutError: Navigation timeout of 60000 ms exceeded Puppeteer encountered an error while running scenario "media center" TimeoutError: Navigation timeout of 60000 ms exceeded COMMAND | Executing core for "report" compare | Reference image not found backstop_default_media_center_00_mobile.png compare | Reference image not found backstop_default_media_center_0__1_tablet.png compare | Reference image not found backstop_default_media_center_02_desktop.png compare | Reference image not found backstop_default_media_center_0__3_wide.png report | Test completed... report | 0 Passed report | 4 Failed

Why would it be looking for "_0__0_mobile" and such when it should be looking for "_0_document0" and such?

The odd thing is that this doesn't occur with all the scenarios. They all create references with "_0document" in the filename, but only some of the tests come up with Reference image not found. The references are there, but some of the the tests just aren't looking for the correct file name for some reason.

The test:

    {
      "label": "media center",
      "url": "https://shielduname:shieldpw@our-dev-site.com/media-center",
      "referenceUrl": "https://our-prod-site.com/media-center"
    },

Generic settings:

"id": "backstop_default",
  "viewports": [
    {
      "label": "mobile",
      "width": 320,
      "height": 3000
    },
    {
      "label": "tablet",
      "width": 568,
      "height": 3000
    },
    {
      "label": "desktop",
      "width": 1024,
      "height": 3000
    },
    {
      "label": "wide",
      "width": 1400,
      "height": 3000
    }
  ],
  "onBeforeScript": "puppet/onBefore.js",
  "onReadyScript": "puppet/onReady.js",
  "readyEvent": "",
  "readySelector": "",
  "delay": 1000,
  "hideSelectors": ["#universal-navigation","#universal-footer"],
  "removeSelectors": ["#universal-navigation","#universal-footer"],
  "hoverSelector": "",
  "clickSelector": "",
  "postInteractionWait": 400,
  "selectors": [],
  "selectorExpansion": true,
  "expect": 0,
  "misMatchThreshold" : 0.5,
  "requireSameDimensions": true,
  "cookiePath": "backstop_data/engine_scripts/cookies.json",
garris commented 2 years ago

Ok. So the problem is probably not the bit about the files not being in the right place -- the problem looks like backstop is not getting a response from your dev box (thus, screen capture fails and weird stuff happens.)

MichaelVanhoutte1 commented 1 year ago

@garris I have this problem aswell in an Alpine Docker container. Could you elaborate on what type of response the dev box should be giving and how this works exactly?

maximilianschlipf commented 1 year ago

I have the same problem when running my test in a Docker container.

garris commented 1 year ago

This error

TimeoutError: Navigation timeout of 60000 ms exceeded

Indicates that BackstopJS made a request for a scenario URL and never received a response. So, It's likely that your docker instance doesn't have access to the URL.

All the business with 0_document-type of errors is just BackstopJS not doing a good job of handling the root cause timeout error.

Hope this helps!

ArunWakekar commented 11 months ago

I am getting the error while the reference file is in there correct location: Reference file not found D:\Dashboard UI\backstop_data\bitmaps_reference\backstop_default_Home_Page_0_document_1_Desktop.png

some time its not taking capturing the test screenshot why?

ENGINE ERROR: net::ERR_ABORTED at https://www.employeeportal.com/

galoliveira commented 10 months ago

@loopy3025 Did you manage to solve it? I have the same problem.