Open mryellow opened 1 month ago
Hello @mryellow :)
I think , The issue is that cy.visit() doesn’t support overriding baseUrl directly. Use Cypress.config('baseUrl', null) globally or manage URLs manually. Check Cypress docs and version for details.
cy.visit('https://another-url.com/path/to/page');
file://
does not work in the same way.
It requires a relative path. Relative local paths are interpreted as URLs when baseUrl
is set.
You'll note the attached issues feature people needing to call Cypress.config('baseUrl', null')
before their cy.visit()
.
Mutating the config for a single call seems a little harsh when what is really required is simply setting baseUrl
for the single cy.visit()
call. Which could be done by adding it to the options
in the signature.
What would you like?
cy.visit()
should itself accept the optionbaseUrl: null
.Then it can be disabled on a case-by-case basis without impacting an entire test by specifying in options for
it
or by callingCypress.config('baseUrl', null)
.Why is this needed?
2918
4450
Other
https://github.com/cypress-io/cypress/blob/0fec07bf7184c9ce5cf0c9068cd5983d8002d93a/packages/driver/src/cy/commands/navigation.ts#L805-L813