How to run cypress command from custom event listener? #22786
Unanswered
johannesstricker
asked this question in
Questions and Help
Replies: 1 comment
-
I am also struggling with this. Something I thought simple is proving rather difficult: Cypress.on('url:changed', (newUrl) => {
log('newUrl', url);
if (url.includes("github.com/login")) {
cy.loginToGithubPages();
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, what I'm trying to achieve is something like this:
This results in an error like this:
I understand that when the event is fired, the callback is not added to the Cypress command queue and instead called synchronously. I guess that's why Cypress is not allowing me to return a promise? How can I get around this?
Beta Was this translation helpful? Give feedback.
All reactions