You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently writing a test that requires Basic Authentication. According to the documentation, it should be possible to handle the authentication if I include the auth object in the command or the credentials in the URL. Unfortunately this does not work and the pop-up is always displayed.
None of these options worked and the browser always shows the pop-up or 401 - Unauthorized if “failOnStatusCode:false” is not set.
Desired behavior
With Cypress I should be able to handle basic authentication (as described in the documentation) so that I can log in to the website and test further functionality.
Current behavior
I am currently writing a test that requires Basic Authentication. According to the documentation, it should be possible to handle the authentication if I include the auth object in the command or the credentials in the URL. Unfortunately this does not work and the pop-up is always displayed.
I have tried the following:
cy.visit('https://admin:[email protected]/basic_auth');
cy.visit('https://the-internet.herokuapp.com/basic_auth', { auth: { username: 'admin', password: 'admin' }, failOnStatusCode: false });
cy.visit('https://the-internet.herokuapp.com/basic_auth', { headers: { authorization: 'Basic YWRtaW46YWRtaW4=' }, failOnStatusCode: false });
None of these options worked and the browser always shows the pop-up or 401 - Unauthorized if “failOnStatusCode:false” is not set.
Desired behavior
With Cypress I should be able to handle basic authentication (as described in the documentation) so that I can log in to the website and test further functionality.
Test code to reproduce
cy.visit('https://admin:[email protected]/basic_auth');
cy.visit('https://the-internet.herokuapp.com/basic_auth', { auth: { username: 'admin', password: 'admin' }, failOnStatusCode: false });
cy.visit('https://the-internet.herokuapp.com/basic_auth', { headers: { authorization: 'Basic YWRtaW46YWRtaW4=' }, failOnStatusCode: false });
Cypress Version
14.1.0
Node version
v22.11.0
Operating System
Windows 11 Enterprise, Edge v133
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: