-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft login removes the Cypress test frame when it redirects, causing tests to fail #21307
Comments
This has been a long-standing issue waaaaay before the introduction of cy.origin, but now that we have a legitimate ability to swap superdomains, I think it needs addressing. We are trying to write tests for checking SSO buttons work correctly by navigating us from our website to the Microsoft login page - I only want to assert the url contains https://login.microsoftonline.com - but due to this bug, can't because the test frame disappears |
We are spiking on which auth providers are frame busting in issue #21342 and will be working through enabling them. |
Thank you, Matt - I'll let my team know to follow along! |
Any Update on when this fix will be released ? |
@Gans79, this is scheduled to be released this week. |
@Gans79 This has just been released in Cypress 10.4.0: https://docs.cypress.io/guides/references/changelog |
First of all huge thanks to the Cypress team for an excellent testing framework. I updated to Cypress 10.4.0, But It does not seem to be working or I have something misconfigured. This is my beforeEach(() => {
cy.origin(`https://login.microsoftonline.com/`, () => {
cy.visit('/');
cy.get('[name="loginfmsst"]').type(`${Cypress.env('email')}{enter}`);
cy.get('[name="passwd"]').type(`${Cypress.env('password')}{enter}`);
cy.get('[type="submit"]').type('{enter}');
});
}) This is my config const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
experimentalSessionAndOrigin: true
},
chromeWebSecurity: false,
}); |
@thecodeholic have you tried adding the new |
@AtofStryker That was the case. Thanks a lot. |
describe("XXX", () => {
it("XXXX", () => {
cy.origin("https://login.microsoftonline.com/", () => {
cy.visit("/");
});
});
}); config file const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
experimentalModifyObstructiveThirdPartyCode: true,
},
}); This works |
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 usingyarn cypress open
) is removed and consequently, Cypress can no longer communicate with the browser and all tests fail.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
The text was updated successfully, but these errors were encountered: