Skip to content

Commit ea26507

Browse files
Andrea BarbassoFrancescoMolinaro
authored andcommitted
[DURACOM-309] disable orejime during e2e tests
1 parent d423f82 commit ea26507

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

cypress/support/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ before(() => {
5656
beforeEach(() => {
5757
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
5858
// This just ensures it doesn't get in the way of matching other objects in the page.
59-
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true}');
59+
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true,"correlation-id":true}');
6060

6161
// Remove any CSRF cookies saved from prior tests
6262
cy.clearCookie(DSPACE_XSRF_COOKIE);

src/app/shared/cookies/browser-orejime.service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,13 @@ export class BrowserOrejimeService extends OrejimeService {
191191
*/
192192
this.translateConfiguration();
193193

194-
this.orejimeConfig.apps = this.filterConfigApps(appsToHide);
195-
194+
if (this._window?.nativeWindow?.Cypress) {
195+
this.orejimeConfig.apps = [];
196+
} else {
197+
this.orejimeConfig.apps = this.filterConfigApps(appsToHide);
198+
}
196199
this.applyUpdateSettingsCallbackToApps(user);
197-
198-
void this.lazyOrejime.then(({ init }) => {
200+
this.lazyOrejime.then(({ init }) => {
199201
this.orejimeInstance = init(this.orejimeConfig);
200202
});
201203
});

0 commit comments

Comments
 (0)