cypress: Some Calls to cy.visit() Fail with a Parse Error when experimentalNetworkStubbing is Turned On
Current behavior:
Some (but not all) of my calls cy.visit are failing with a generic Parse Error when I have experimentalNetworkStubbing turned on. One such failing call is in the provided below.
Desired behavior:
Calls to cy.visit succeed regardless of whether or not experimentalNetworkStubbing is on.
Test code to reproduce:
it('Issue with cy.visit when experimentalNetworkStubbing is On', function () {
// This test will pass when experimentalNetworkStubbing is off, but will fail when it is on.
cy.visit('https://secure.vidyard.com/user/sign_in')
})

Versions:
Cypress version 5.1.0 on macOS 10.14.6 using Chrome 85.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 15 (5 by maintainers)
I ran into this issue as well. Building on the workaround from @alim16, I added the following to
cypress/support/commands.js. This should “fix” the built-invisitcommand to work around the issue so you don’t have to change any of your tests.Caveats:
visitcalls, so it may slow things down a bit and/or have unintended side effects on tests that don’t experience the redirect issue at allvisitcommandin case anyone is looking for a temporary workaround, here is mine I use cy.request to find the redirect url and then cy.visit
//my function looks like this
//and my test would look like this
@todd-m-kemp I needed an example url and can’t use mine, I hope you don’t mind
my experience with cypress is limited so if anyone has better/easier way, please let me know
I have the same problem and my route also redirects.
@alim16 Agreed; I noticed the same thing and wondered if it was related to redirects. It certainly seems to make sense based on what we are both experiencing.