💡 What will happen after running the following test?
it('should pass?', () => {
cy.visit('https://cypress.io');
cy.visit('https://cypressquiz.com/');
cy.get('h1').should('contain.text', 'Quiz');
});
A | Test will pass
B | Test will fail
C | AssertionError, expected 'Test. Automate. Accelerate.' to contain text 'Quiz'
🎉 Quiz Completed! 🎉
The test will fail because you can't visit two domains of different superdomains in the same test and continue to interact with the page.
However, you can use
cy.origin() to overcome this limitation. Also, read more about
Cross Origin Testing