Skip to content

Commit

Permalink
cypress: Replace obsolete Cypress.Cookies.preserveOnce
Browse files Browse the repository at this point in the history
  • Loading branch information
mamedin committed Sep 28, 2023
1 parent d1c1db7 commit 83e7bfd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions cypress/e2e/finding_aid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ describe(

beforeEach(() => {
// Preserve authentication cookies between tests
cy.session('unique_identifier', cy.login, {
validate () {
cy.getCookies().should('have.length', 3)
},
})
cy.getCookies().then((cookies) => {
const cookiesToPreserve = ['atom_authenticated', 'symfony'];
cookiesToPreserve.forEach((cookieName) => {
const cookie = cookies.find((c) => c.name === cookieName);
if (cookie) {
cy.setCookie(cookie.name, cookie.value, {
// Add any additional options if needed
// For example, { domain: 'example.com' }
});
}
});
});
})

it('Disables finding aids', () => {
Expand Down

0 comments on commit 83e7bfd

Please sign in to comment.