0

I have cypress UI tests running remotely. Our authentication team has recently made a change that redirects the page twice, previously only once. This change has caused my tests to fail at cy.visit('/') with error "Exceeded maxRedirects. Probably stuck in a redirect loop https://mybetawebsite/redirect=signin&redirect=signin"

When I asked them about this erorr, they told me to follow the redirect a second time.

I know cy.visit follows redirects (https://docs.cypress.io/api/commands/visit#Redirects) , but it does only once or multiple times?

Previously, when my tests were passing, I could see 302(redirection) at cy.visit (to different url for auth) and test used to continue and pass.

in my cypress.json, baseUrl: https://mybetawebsite

How do I handle second redirect?

PriyaK
  • 23
  • 3
  • Monitor the redirects during the `cy.visit()` to get a good determination of the response codes of the redirects. Cypress has a default [`redirectionLimit`](https://docs.cypress.io/guides/references/configuration#Global) of 20. – jjhelguero Feb 23 '22 at 03:09
  • Add the code that you are trying. – Alapan Das Feb 23 '22 at 06:04
  • @jjhelguero Actually i do not see any response code. I get message "We attempted to make an http request to this url but the request failed without a response" – PriyaK Feb 24 '22 at 11:57

0 Answers0