cypress: cypress reloads in infinite loop when calling cy.visit to http URL that upgrades to https.
Current behavior
When visiting a page that triggers certain redirects, the test runner keeps reloading and looping endlessly.
Desired behavior
Not reload the test runner and follow redirects.
Test code to reproduce
describe('example cypress reload issue', () => {
it('keeps reloading', () => {
cy.visit('https://enexis.nl/mijn-enexis/mijn-aanvragen')
})
})
Cypress Version
12.6
Node version
18.12.1
Operating System
Win 11
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 4
- Comments: 44 (20 by maintainers)
We observed this unexpected looping behaviour when Cypress was running on https:// in the Chrome browser that it was driving. The server for our system under test (SPA web app) only supports the http:// protocol. When we manually removed the s in the URL bar in the Cypress-driven Chrome, it began behaving as expected again (no looping).
Between our tests running fine on Firefox and the comment above by @BevanR (thank you!), I’m wondering if this may be related to Chrome’s recent change to use HTTPS by default.
We’re narrowing in on a solution. So will hopefully have some updates soon on this.
UPDATED
Below instructions works around the issue, until a proper solution is made
Both PART1 and PART2 are required
PART1 - in
itblockPART2 - in cypress config
Internal (not exposed to the Internet) company apps generally use http
@tudorgabriel the fix on Cypress’s side isn’t released yet
I updated the workaround here: https://github.com/cypress-io/cypress/issues/25891#issuecomment-1861098656
I am only seeing this with
cypress open, I don’t see this withcypress runDoes anyone see the same?