-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress can hang when pageLoadTimeout event fired when redirecting back to our app after logging in using Microsoft AAD #30238
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@blackgrouse Does this code work in non-Chrome browsers? Like Electron or Firefox? It reminds me of this issue, which we have a workaround for if that is the case. |
@jennifer-shehane Thanks for getting back to me. Yes, I'm able to reproduce in Electron. |
Hi @jennifer-shehane any updates for me on this please? You hint at a workaround - is that on my end or yours? |
@jennifer-shehane is there any update on this please? |
Hi @jennifer-shehane I have provided the information you requested quite a while ago so I was wondering if there was any feedback on this? Our app is deployed by our pipeline after successful E2E tests and this issue is causing big issues for us and impacts our ability to deploy our app first time, every time, handsfree. It also impacts the trust of the business of the effectiveness and quality of our testing, so any information you can provide would be gratefully received. |
@blackgrouse There are no errors at the time this occurs in the console? We'd need a way provided to test this on our end to narrow down the issue. We have Microsoft AAD tests that we run continuously that are passing and not encountering this issue, so it has to be something specific to the rerouting behavior back to your site - especially since that's where it's hanging. It's strange to see the amazon.aws URL as in the errored state - you said it 'retrieve data from AWS S3 to be displayed'. Is there something not working in that communication specifically? |
I have managed to get a consistent repro of the issue by forcing the If I remove the problem plugins the test fails as expected. There is a repo that can recreate the issue: https://github.com/squaredup/cypress-issue-repro |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
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: