Cypress can hang when pageLoadTimeout event fired when redirecting back to our app after logging in using Microsoft AAD #30238
Labels
stage: needs information
Not enough info to reproduce the issue
Current behavior
Cypress can hang when a pageLoadTimeout event is received when redirecting back to our app after logging in using Microsoft AAD which is causing issues in our CI/CD environment (Azure DevOps (ADO) ubuntu-22.04).
Our app uses MS AAD to authenticate users and we are automating this using v13.8.1
cy.session()
andcy.origin()
commands with code based on this blog. I have had to tweak the code slightly as our login page is hosted by Microsoft.Here is my version of the login code via the custom command cy.loginWithMicrosoftAccountAndSelectOrg():
The UI flow is:
Most of the time this works fine, but sometimes, after step 3, Cypress hangs and doesn't redirect to our app. On debugging, we are not receiving a
load
event so that Cypress fires apageLoadTimeout
event, which should cause the test to fail. Unfortunately it does not, Cypress hangs at this point and continues running infinitely until stopped - by the user locally, or by ADO after a predefined amount of time. In the latter case, this fails the build, which obviously impacts our delivery efficiency as we have to rerun any builds which have failed in this way.The last line executed was:
and then there is no more activity in the test runner.
I have been able to reproduce this on my Mac 14.6.1 and the latest version of Cypress. Here is a screenshot of the test runner when failing locally:
Desired behavior
The desired behaviour is that Cypress should not hang but should allow the test to fail as expected.
Test code to reproduce
I have not had time to provide a failing test, but provide example code
Cypress Version
13.8.1
Node version
20.16.0
Operating System
macOS 14.6.1 and ubuntu 20.04
Debug Logs
Happy to provide logs if you tell me which ones would be helpful.
Other
No response
The text was updated successfully, but these errors were encountered: