If I have a baseUrl in cypress.json:
{
"baseUrl": "http://username:[email protected]"
}
then a basic cypress run does not work. I get this error:
Timed out waiting for the browser to connect. Retrying...
This also happens if I run --headed.
It does work in latest Chrome (66).
It should open the page with basic auth data.
baseUrl to cypress.json:{
"baseUrl": "http://username:[email protected]"
}
cypress runCypress 2.1.0
Important note: It works with the auth parameter in "cy.visit".
We ran into this issue in our project when updating Cypress from 1.4.2 to 2.1.0. There is a workaround based on (https://github.com/cypress-io/cypress/issues/1115).
We extended Cypress's visit command with:
Cypress.Commands.overwrite('visit', (orig, url, options) => {
options = options || {};
options.auth = {
username: Cypress.env('AUTH_USER'),
password: Cypress.env('AUTH_PASS')
};
return orig(url, options)
});
and we are running it with:
CYPRESS_AUTH_USER=user CYPRESS_AUTH_PASS=pass CYPRESS_baseUrl=https://app.com cypress run
Hello Cypress team!
It is there any information about a roadmap to fix this bug or something?
Cypress 3.1.4 seems to work ok on my Mac (at least with Chrome). However, this problem occurs when running Cypress 3.1.4 with Electron on cypress/base:10 Docker image (Debian + Node.js 10.13).
Basic auth seems to work ok, if you just don't set the baseUrl configuration parameter at all and you make the calls using a full url (e.g. cy.visit('https://user:[email protected]'). If you have set the baseUrl configuration parameter, Cypress probably gives that url to the browser even before the tests are run, and that time the timeout problem occurs. Even this dummy test fails to a connection timeout, if the baseUrl configuration parameter has been set:
describe('My First Test', function() {
it('Does not do much!', function() {
expect(true).to.equal(true)
})
})
Actually the problem occurs also on Mac if you have set the baseUrl configuration parameter and choose Electron 56 as the browser. You wont see the same connection timeout error message, but you'll see that the browser won't load anything, it just stays blank. Try again with an undefined baseUrl and everything works ok. (Note that baseUrl must be undefined. Empty string as baseUrl won't work the same way.)
Duplicate of https://github.com/cypress-io/cypress/issues/1598
Most helpful comment
We ran into this issue in our project when updating Cypress from
1.4.2to2.1.0. There is a workaround based on (https://github.com/cypress-io/cypress/issues/1115).We extended Cypress's
visitcommand with:and we are running it with: