-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
topic: cy.originProblems or enhancements related to cy.origin commandProblems or enhancements related to cy.origin command
Milestone
Description
Current behavior
Using 9.6.0, I want to use the origin function to firstly, login through Microsoft and then continue with the test within the baseUrl.
Using the code below, when cy.visit('/'); is executed, the test frame around Cypress (when using yarn cypress open) is removed and consequently, Cypress can no longer communicate with the browser and all tests fail.
describe('Authenticate', () => {
beforeEach(() => {
cy.origin('https://login.microsoftonline.com', () => {
cy.visit('/');
cy.get('[name="loginfmt"]').type(`${Cypress.env('email')}{enter}`);
cy.get('[name="passwd"]').type(`${Cypress.env('password')}{enter}`);
cy.get('[type="submit"]').type('{enter}');
});
});
it('Show homepage once logged in', () => {
});
});
Is there a working solution for this?
Desired behavior
For the Cypress test frame to persist whilst the login occurs.
Test code to reproduce
As above.
Cypress Version
9.6.0
Other
No response
manoj-mukherjee-maersk, far11ven, kohheepeace, tobilen, crenardy and 3 more
Metadata
Metadata
Assignees
Labels
topic: cy.originProblems or enhancements related to cy.origin commandProblems or enhancements related to cy.origin command