question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Multi-domain]: Support nested multi-domain commands

See original GitHub issue

Add support for nested multi-domain commands, for cases where you visit multiple domains in a row before ending up back on the test’s primary domain.

cy.visit('http://domain1.com')
cy.get('a').click() // takes you to domain2.com
cy.origin('domain2.com' () => {
  cy.get('a').click() // takes you to domain3.com
  cy.origin('domain3.com', () => {
    cy.get('[data-cy="username"]').type('myusername')
    cy.get('[data-cy="login"]').click() // takes you back to domain1.com
  })
})
cy.get('h1').invoke('text').should('equal', 'Welcome, myusername!')

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:19
  • Comments:6

github_iconTop GitHub Comments

3reactions
davidmastreamlinecommented, May 13, 2022

Im trying to use cy.origin() to log in through auth0 (which works) but then I need to nest another cy.origin() to sign in with google in Auth0. Im getting this error Screen Shot 2022-05-13 at 1 47 15 PM

2reactions
AleksiUucommented, Aug 1, 2022

@modern-sapien This solution works perfectly and allows multi-domain login flow to be implemented finally! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-Domain (Origin) Testing in Cypress - DEV Community ‍ ‍
Let's add the following code into our support/commands.js file. Cypress.Commands.add(" ...
Read more >
Cypress 9.6.0: Easily test multi-domain workflows with cy.origin
The solution: multi-domain testing. With cy.origin() you can execute commands against any number of superdomains, all in the context of a single ...
Read more >
Enable or disable multidomain name mapping searches
Multidomain name mapping searches are enabled by default. This option is available at the advanced privilege level. Steps. Set the privilege ...
Read more >
Considerations for Multi-Domain Operation Success
command as the lead DOD entity to integrate, synchronize, and coordinate multi-domain operations (MDO) across the United States Government ...
Read more >
Multi-Domain Command and Control
As MDC2 concepts mature in the coming years an overarching combined-arms Grand Strategy is needed so that each Service and NATO MDC2 strategies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found