Company
Date Published
Author
The Cypress
Word count
1289
Language
English
Hacker News points
None

Summary

Cypress 12 introduces a long-awaited cross-origin testing feature via the cy.origin() command, allowing testers to seamlessly switch between multiple origins, addressing previous limitations imposed by the same-origin policy. This capability is achieved through the use of iframes and the postMessage mechanism, enabling communication between different origins while maintaining the benefits of Cypress's native browser execution. The new feature simplifies testing scenarios that involve syndicated login services and integrated systems, which were previously challenging due to browser restrictions. The implementation maintains test reliability and user-friendly interface by using a complex under-the-hood architecture, ensuring commands execute correctly during cross-origin navigation. Additional functionalities like the modifyObstructiveCode and experimentalModifyObstructiveThirdPartyCode options help users handle framebusting techniques and third-party authentication services. Cypress's commitment to user feedback and continuous improvement is highlighted, with plans to update documentation and encourage community interaction through platforms like GitHub and Discord.