diff --git a/cypress/e2e/spec.cy.js b/cypress/e2e/spec.cy.js index f252c54..44a4094 100644 --- a/cypress/e2e/spec.cy.js +++ b/cypress/e2e/spec.cy.js @@ -6,6 +6,19 @@ describe('issue https://github.com/cypress-io/cypress/issues/25841 reproduction' cy.contains('FLASH_FROM_REDIRECT_ACTION').should('be.visible') cy.visit('/page_b') cy.contains('THIS_SHOULD_BE_VISIBLE_AFTER_BUTTON_CLICK').should('not.exist') + + // Workaround odea by @ksazhnev + // https://github.com/cypress-io/cypress/issues/25841#issuecomment-1807468630 + // + // However, this requires clicking the button twice. + cy.intercept('POST', '/set_the_flash').as('firstRequest') + cy.contains('Trigger fetch request').click() + cy.wait('@firstRequest').then((interception) => { + // Delete all cookies after sending the request + cy.clearCookies(); + }) + // --- end of workaround. + cy.contains('Trigger fetch request').click() cy.contains('THIS_SHOULD_BE_VISIBLE_AFTER_BUTTON_CLICK').should('be.visible') })