I have another post here about this but I'm trying to figure this part out specifically. Does
page.evaluate act differently in CI vs locally? I've run the same set of tests several times with 150 passing locally, but if I push to CI, I get an error stating execution context was destroyed due to navigation. I'm not using any custom sharding but we are using
beforeEach to reset tests.
This thread is trying to answer question "Does `page.evaluate` act differently in CI vs locally and how can the issue be resolved?"
Be sure to enable trace files in CI, and to upload them somewhere, so you can easily troubleshoot what's going wrong in CI: https://playwright.dev/docs/trace-viewer-intro
I think it's more likely just a timing issue, because CI agents are usually not as strong as developer PCs.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email firstname.lastname@example.org.