BackstopJS
BackstopJS copied to clipboard
Backstop hangs on last scenario when using "readyEvent"
We've got a static Gatsby site running and we're using backstop for visual regression. For the most part it has been working pretty well for us.
One thing I wanted to improve is the hard coded delays that are in place via use of the readyEvent and so we implemented a console log accordingly. The problem that I have and cannot figure out is backstop appears to hang indefinitely when using readyEvent. At first I thought it would hang in random spots but then realized it was also hanging on the very last scenario as defined in the backstop.json file.
Things I've tried:
- Running with and without docker
- Running with an async capture and compare limit of 1 but this didn't help (it would still hang)
- Running a single scenario works fine with
readyEvent
Has anyone else experienced this, looking for some insight.
Thanks
One common issue here happens when a console event fires prior to backstop initializing in your app. This is probably what is happening. Potentially, instead of using the console you can use readySelector. If you need an arbitrary event you can put a noop class on your body that backstop would wait for.
Thanks @garris. So it sounds like I should forgo using readyEvent. I'll try with readySelector and see how it goes. We're not too keen on the idea of a noop class, but going to see if this may work for us.
Thank you
I had some issues with readyEvent and started to look for workarounds. One solution was to hack a timeout into BackstopJS so that a failing test would block the suite which is a PITA with automated testing. The other approach was to try a custom readyProperty within onBefore. The idea is to wait for a global JS-Variable being set by the page's code.
Here i have the same issue that after last scenario will finish when using any readyEvent will not stop process.
Here i have the same issue that after last scenario will finish when using any readyEvent will not stop process.
Ya, readyEvent is still a no go for me. I'm still stuck on using a hard coded wait. @garris Anymore thoughts/ideas on this?
I fear we have to patch Backstop and hope that Garris approves our patch. But with 53 pull requests waiting I have no hope. Too bad Backstop is a one person project.
Its ordinary to wait for a class or other DOM state using the regular backstop config. And if you really need something custom you can add it to the onReady script without any need to post a PR. This is no different from using vanilla puppeteer or selenium.
Maybe you can prototype your scenario in puppeteer to arrive at a convention you prefer and then use that pattern in your onReady script.
Hi @garris , I guess the request is about to let it timeout in some time and to log something to console whats going on
Sorry @raDiesle -- it is hard for me to understand the issue here.
I've just tried out readyEvent and I have the same issue ...
I've just created a PR to fix the hanging; any idea who can release it?
@klodoma Nice! Looking forward to testing this out.
We can close this one: https://github.com/garris/BackstopJS/pull/1338