Skip to content

Cypress 9.1.0 freezes if baseUrl changes between tests #19105

@Dospios

Description

@Dospios

Current behavior

In my tests, it is necessary to open an html file locally in one of the tests. It is impossible to do this with baseUrl, so for this test I reset baseUrl, but subsequent tests continue to use baseUrl, which is set globally in cypress.json. I saw such a solution here - #4450 (comment)
In cypress 9.0.0 and below, this method worked, but in 9.1.0, the execution of tests freezes if, after a test with base Url = null, a test is run in which baseUrl is set globally. At the same time, the test runner continues to work until it is stopped manually. There is an error in the console
image

www.cypress.io-1637826397522.log

Desired behavior

The execution of the tests continues correctly, just as it was in version 9.0.0.
And it is better to make it possible to visit local files with an existing baseUrl

Test code to reproduce

You can use any local html file for the test

it('Base url = null', { baseUrl: null }, () => {
  cy.visit('cypress/downloads/test.html')
})

it('Base url = https://www.cypress.io/', () => {
  cy.visit('/')
})

in cypress.json

"baseUrl": "https://www.cypress.io/"

Cypress Version

9.1.0

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions