Cypress error

cy.visit() failed because you are attempting to visit a URL that is of a different origin

Cypress runs a test in one origin at a time, and the test tried to cross to a different domain mid-flow.

Why this happens

How to fix it

  1. Wrap the cross-origin portion in `cy.origin('https://other-domain.com', () => { ... })`
  2. If the cross-origin hop isn't essential to what you're testing, split it into a separate, focused test instead