Created a new function clickAndWait that will call page.click and then page.waitFor. Running this a bunch of times locally and it seems to pass reliably now.
puppetter-config.js
Lots of our setup (user fixtures + debugging methods, etc) is duplicated across files.
Created a new file to hold all of the shared code we use in our puppeteer tests.
Keeping it in a __tests__ directory meant I had to change the jest config to not try to run this file as a test. If we think that's a bad idea, we can put this somewhere else maybe.
waitFor after clicking page navigation
We were seeing a lot of intermittent failures running
yarn test:full
with the puppeteer tests giving us anExecution context was destroyed
error.Seems like that error message is trying to tell us that the page is being navigated away from in a way that puppeteer doesn't like. Someone suggested using page.waitFor because that solved their issue. Seems to work for our case.
Created a new function
clickAndWait
that will callpage.click
and thenpage.waitFor
. Running this a bunch of times locally and it seems to pass reliably now.puppetter-config.js
Lots of our setup (user fixtures + debugging methods, etc) is duplicated across files.
Created a new file to hold all of the shared code we use in our puppeteer tests.
Keeping it in a
__tests__
directory meant I had to change the jest config to not try to run this file as a test. If we think that's a bad idea, we can put this somewhere else maybe.