Cypress error

CypressError: cy.origin() failed because your callback function returned a promise

cy.origin() callbacks must be synchronous, plain functions, with no async/await and no closures over outer-scope variables.

Why this happens

How to fix it

  1. Make the callback a plain, synchronous function
  2. Pass data in through `cy.origin()`'s third `args` parameter instead of closing over outer-scope variables