// As an extra escape hatch, you can choose to run or not run certain client-side code during Cypress tests by checking // for the window.Cypress value. We highlight some example use cases for why you'd need to do this below // If we're running an A/B experiment where different views may show up for a user, // we need to make sure it doesn't lead to Cypress test flakiness by choosing not to run A/B tests during Cypress tests if (!window.Cypress) { runABExperiment(); } // If one of our flows deals with an auto-downloading link which may lead to breaking/pausing Cypress tests // due to the file download, we can choose to focus on the success state showing up without actually downloading the file // during Cypress tests const autoDownloadLink = () => { if (window.Cypress) { // Skip actually downloading the file in Cypress tests return; } // Outside of Cypress tests, auto download the file... };