1
Procedure in Google Chrome
I have an Azure B2C login page, enter the user and password and press the "Login" button and then normally. In this process I am redirected to my application page with a token:
https://minhapagina?token=a1df6a5d1fa65...
This page is a Webform with some radios button
where I have a button to access the application, if I click this button I access the application.
Cypress code
The code is very simple
describe('Test B2C', () => {
it('Login', () => {
var testUrl = 'https://urlB2C...';
cy.visit(testUrl).then(() => {
cy.get('#signInName').type('usuario');
cy.get('#password').type('senha');
cy.get('#next').click();
});
});
})
Problem
Performing the manual process, in case using Google Chrome works normally, however doing the same process with Cypress when arriving at the last step which is to click the screen button with the radios button
I am redirected to the B2C login screen without any error message or warning.
Remarks
- If you execute only the command
cy.visit
to open the page and do all manual process within Cypress the problem continues. - If you do the procedure by taking the url directly
https://minhapagina?token=a1df6a5d1fa65...
inside the Cypress works. - I did the same automation using Selenium and it also worked.
- The flag
chromeWebSecurity
already this with the valuefalse
.
Good answer. That hole has some alternatives waiting to load the new page, maybe some will serve you better. This specific point may even be a new question, it is definitely useful for those who use Cypress :)
– Rafael Tavares