119602: Set all cookies before e2e specs

This commit is contained in:
Andreas Awouters
2025-03-07 10:34:14 +01:00
parent 4cea196eb2
commit a2882b0644
2 changed files with 6 additions and 2 deletions

View File

@@ -54,9 +54,12 @@ before(() => {
// Runs once before the first test in each "block"
beforeEach(() => {
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
// Pre-agree to all Orejime cookies by setting the orejime-* cookies
// This just ensures it doesn't get in the way of matching other objects in the page.
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true,"accessibility":true}');
const cookieContent = '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true,"accessibility":true}';
cy.setCookie('orejime-anonymous', cookieContent);
cy.setCookie(`orejime-${Cypress.env('DSPACE_TEST_ADMIN_USER_UUID')}`, cookieContent);
cy.setCookie(`orejime-${Cypress.env('DSPACE_TEST_SUBMIT_USER_UUID')}`, cookieContent);
// Remove any CSRF cookies saved from prior tests
cy.clearCookie(DSPACE_XSRF_COOKIE);