stale-helicopter-67510
09/26/2022, 12:38 PMcy.origin
and cy.session
commands, yet seem to be stumbling a bit.
Cypress.Commands.add("loginToAuth0", (email, password) => {
const args = { email, password };
cy.session(args, () => {
cy.visit("/"); // root redirects to auth0
cy.origin("https://ORGANISATION.eu.auth0.com", () => {
cy.wait(20000); // making sure not a loading issue
cy.get("input"); // no selectors work, but one exists
});
});
});
Issue being with this current setup is that no input is detected, even though I pause and i can see from the screen that an input exists (the organization input). It even exists when I try and inspect element. So what could be causing the input to not appear even though the screen shows it and it exists in the DOM.
I found a similar stackoverflow issue (https://stackoverflow.com/questions/73660286/cy-origin-unable-to-find-any-elements-on-auth0-page) but the only solution there is to remove the cy.origin
command and that does indeed work, but isnt that a bit counterintuitive?