Skip to content

Commit

Permalink
fix: add validate to e2e config
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeperrault authored and maximeperraultdev committed Sep 18, 2024
1 parent 761f54b commit f44d020
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frontend/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ beforeEach(() => {
// We use a Cypress session to inject inject a Local Storage key
// so that we can detect when the browser app is running in Cypress.
// https://docs.cypress.io/faq/questions/using-cypress-faq#How-do-I-preserve-cookies--localStorage-in-between-my-tests
cy.session('cypress', () => {
window.localStorage.setItem('IS_CYPRESS', 'true')
})
cy.session(
'cypress',
() => {
window.localStorage.setItem('IS_CYPRESS', 'true')
},
// https://www.cypress.io/blog/mistake-when-using-cy-session-and-how-to-solve-it
{
validate() {
window.localStorage.getItem('IS_CYPRESS') === 'true'
}
}
)
})

0 comments on commit f44d020

Please sign in to comment.