Open dlatikaynen opened 1 year ago
I was able to reproduce the error. There seems to be some flake on when the final page that is being navigated to after submitting the login form is loaded. I could get the test to pass when Cypress first loads in open mode, then it would fail if rerun. However, if I just navigated to another page (like Settings) and back to run the spec, then it would pass again ever so often. Sometimes it seemed like every other time.
The load
window event is not being fired in the cases it fails so the logic navigation.ts
never fires to cancel the timeout that is waiting for the page to load here: https://github.com/cypress-io/cypress/blob/b3fd048fbc1b920251e145b050494909449005c9/packages/driver/src/cy/commands/navigation.ts#L354
I will forward this ticket to the appropriate team. They will soon evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate status changes during evaluation, so we ask that you please refrain from asking for updates. Thanks!
Is there any workaround for this? We experiencing maybe something similar with our oidc flow. In our case it the first describe
section works with cypres run
. All following are running into
(page load) --waiting for new page to load--
This happens mostly only on the pipeline, not when running the test from the local machine.
Current behavior
npx cypress run
--> test fails instantly, from the video it can be seen that there is a timeout after 70 seconds with the messagenpx cypress open
--> test always works fast and perfectly well on the initial run in a pristine cypress window. but as soon as we repeat the test run, it fails. It also fails when we only close the cypress browser window. Only if we also close the cypress main window (which ends the cypress process), then it works again once on the next open.Desired behavior
The test should always succeed, without the need to terminate the cypress process inbetween runs. The cypress run approach should always work.
Test code to reproduce
cypress-issue-MCVE.zip cypress_debug_output.zip
Full MCVE in attached ZIP file. Relevant test code:
Cypress Version
12.15.0
Node version
18.14.2
Operating System
Windows 10 21H2 19044-3086
Debug Logs
Other
We would look into other ways to get the token, but in our use case it absolutely makes sense to include the actual authentication flow in the e2e testing because the identity server is part of the test candidate project. We would not regard this as a bug, had it not worked on initial cypress start. The fact that it does so, points to some kind of state being persisted and not cleared after the initial run. Cookies and localstore were inconspicious, additionally calling clearallcookies, clearalllocalstorage and clearallsessionstorage changed nothing. Also, tests with other browsers than electron remained inconclusive. we did not pursue this further; we had the impression that on chrome, it never worked properly but then there were certificate errors and other stuff that electron did not have. so the MCVE included with this report assumes electron only.
github tells me "body is too long". so we included the full debug output as another attachment, the text in "Debug Logs" is truncated.