Skip to content

Commit 3306221

Browse files
committed
click orejime popup accept after login
1 parent 99c5506 commit 3306221

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

cypress/support/commands.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ declare global {
5050
* @returns Chainable reference to allow CSRF token to also be sent in header.
5151
*/
5252
createCSRFCookie(): Chainable<any>;
53+
54+
/**
55+
* Click accept in the Orejime cookie popup
56+
* */
57+
acceptOrejimePopup(): typeof acceptOrejimePopup;
5358
}
5459
}
5560
}
@@ -106,6 +111,9 @@ function loginViaForm(email: string, password: string): void {
106111
cy.get('[data-test="password"]').type(password);
107112
// Click login button
108113
cy.get('[data-test="login-button"]').click();
114+
115+
// wait for the browse to redirect to the reload page, and back
116+
cy.acceptOrejimePopup();
109117
}
110118
// Add as a Cypress command (i.e. assign to 'cy.loginViaForm')
111119
Cypress.Commands.add('loginViaForm', loginViaForm);
@@ -173,3 +181,13 @@ function createCSRFCookie(): Cypress.Chainable {
173181
}
174182
// Add as a Cypress command (i.e. assign to 'cy.createCSRFCookie')
175183
Cypress.Commands.add('createCSRFCookie', createCSRFCookie);
184+
185+
/**
186+
* Click accept in te Orejime cookie popup
187+
*/
188+
function acceptOrejimePopup(): void {
189+
cy.get('.orejime-Notice-saveButton').click();
190+
}
191+
Cypress.Commands.add('acceptOrejimePopup', acceptOrejimePopup);
192+
193+

0 commit comments

Comments
 (0)