Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backstop hangs on last scenario when using "readyEvent" #1208

Open
cvolpe13 opened this issue Jul 13, 2020 · 13 comments
Open

Backstop hangs on last scenario when using "readyEvent" #1208

cvolpe13 opened this issue Jul 13, 2020 · 13 comments

Comments

@cvolpe13
Copy link

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

@garris
Copy link
Owner

garris commented Jul 13, 2020

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.

@cvolpe-ecobee
Copy link

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

@masi
Copy link

masi commented Sep 14, 2020

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.

@raDiesle
Copy link

raDiesle commented Dec 4, 2020

Here i have the same issue that after last scenario will finish when using any readyEvent will not stop process.

@cvolpe13
Copy link
Author

cvolpe13 commented Dec 4, 2020

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?

@masi
Copy link

masi commented Dec 4, 2020

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.

@garris
Copy link
Owner

garris commented Dec 5, 2020

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.

@raDiesle
Copy link

raDiesle commented Dec 5, 2020

Hi @garris ,
I guess the request is about to let it timeout in some time and to log something to console whats going on

@garris
Copy link
Owner

garris commented Dec 5, 2020

Sorry @raDiesle -- it is hard for me to understand the issue here.

@klodoma
Copy link
Contributor

klodoma commented Jun 21, 2021

I've just tried out readyEvent and I have the same issue ...

@klodoma
Copy link
Contributor

klodoma commented Jul 8, 2021

I've just created a PR to fix the hanging; any idea who can release it?

@cvolpe13
Copy link
Author

cvolpe13 commented Jul 8, 2021

@klodoma Nice! Looking forward to testing this out.

@klodoma
Copy link
Contributor

klodoma commented Sep 5, 2022

We can close this one:
#1338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants