DEV Community

JigNect Technologies
JigNect Technologies

Posted on

Cypress - Cross-Origin support - yay

Crossing origins is super common with sites that use third-party authentication, for example. Before, you would have to use programmatic authentication in Cypress tests, but this wasn’t indicative of how a real person would use the app. Now with cross-origin support, you no longer need to work around your login flow:

Due to how Cypress executes your tests in a browser, visiting another site was a huge technical hurdle due to cross-origin security limitations.

In Cypress 12 cy.session() included, which support out of experimental and into general availability status. Session support can tie closely with cross-origin in that you can save a user session (storage, cookies, etc.) after authentication and restore it in a subsequent test. This cuts down on overall test suite execution time as each test won’t need to go through the authentication flow.

Sample Code:

Image description

Read more at Cross-Origin-Testing

Witness how our meticulous approach and cutting-edge solutions elevated quality and performance to new heights. Begin your journey into the world of software testing excellence. To know more refer to Tools & Technologies & QA Services

Happy Automated Testing 🙂

Top comments (0)