From 4bfcf33a40798deff2e74c8d1f7984efcc744d8d Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Tue, 28 Nov 2023 12:04:17 +0100 Subject: [PATCH] fix(e2e): fix admin password, default redirect behavior for login --- apps/metadata-editor-e2e/src/e2e/home.cy.ts | 2 +- tools/e2e/commands.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/metadata-editor-e2e/src/e2e/home.cy.ts b/apps/metadata-editor-e2e/src/e2e/home.cy.ts index 02e60f9d03..f9da3186b5 100644 --- a/apps/metadata-editor-e2e/src/e2e/home.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/home.cy.ts @@ -49,7 +49,7 @@ describe('avatar', () => { }) describe('display avatar for user with hash', () => { it('should display the correct profile picture', () => { - cy.login(fakeUser.username, fakeUser.password) + cy.login(fakeUser.username, fakeUser.password, true) cy.get('gn-ui-avatar') .children('img') .should('have.attr', 'src') diff --git a/tools/e2e/commands.ts b/tools/e2e/commands.ts index 0c2e85d3c2..2e29d3b5d6 100644 --- a/tools/e2e/commands.ts +++ b/tools/e2e/commands.ts @@ -25,13 +25,13 @@ declare namespace Cypress { Cypress.Commands.add( 'login', - (username = 'admin', password = 'password', redirect = true) => { + (username = 'admin', password = 'admin', redirect = false) => { // first request to get the XSRF cookie cy.request({ method: 'GET', url: '/geonetwork/srv/api/me', headers: { - Accept: 'application/json, text/plain, */*', + Accept: 'application/json', }, }) cy.getCookie('XSRF-TOKEN').then((xsrfTokenCookie) => {