'Cypress, how to prevent error like: Must be in a top-level browsing context

(uncaught exception)
SecurityError: Failed to construct 'PaymentRequest': Must be in a top-level browsing context or an iframe needs to specify allow="payment" explicitly

At the end of the payment process workflow land in a 3rd party website.

  1. Either I would check the content of the url
  2. or fill some data and let it navigate back to my site
  3. but no way I would ask a warning

Which of the 3 is possible with Cypress and how?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source