From 343d5f5bad970a141310f0000079961c695c6b06 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Fri, 6 Oct 2023 13:01:28 +0200 Subject: [PATCH] e2e: quicker login, fix filter by favorite --- apps/datahub-e2e/src/e2e/datasets.cy.ts | 1 - apps/datahub-e2e/src/e2e/home.cy.ts | 7 +++++-- apps/datahub-e2e/src/e2e/organizations.cy.ts | 6 ------ apps/datahub-e2e/src/support/commands.ts | 2 +- apps/datahub-e2e/src/support/e2e.ts | 4 ++++ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/datahub-e2e/src/e2e/datasets.cy.ts b/apps/datahub-e2e/src/e2e/datasets.cy.ts index b4485ad2cf..747c81b584 100644 --- a/apps/datahub-e2e/src/e2e/datasets.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasets.cy.ts @@ -4,7 +4,6 @@ describe('datasets', () => { beforeEach(() => { cy.clearCookies() cy.visit('/search') - cy.viewport(1700, 1200) // aliases cy.get('gn-ui-results-list-item').find('a').as('results') diff --git a/apps/datahub-e2e/src/e2e/home.cy.ts b/apps/datahub-e2e/src/e2e/home.cy.ts index cb1dbec2a2..12952662a2 100644 --- a/apps/datahub-e2e/src/e2e/home.cy.ts +++ b/apps/datahub-e2e/src/e2e/home.cy.ts @@ -90,10 +90,13 @@ describe('header', () => { .find('[data-cy=recordTitle]') .invoke('text') .as('favoriteTitle') - cy.get('@favoriteItem').find('gn-ui-favorite-star').click() + cy.get('@favoriteItem').find('gn-ui-favorite-star button').click() + cy.wait(100) // show my favorites only - cy.get('datahub-header-badge-button[label$=favorites]').realClick() + cy.get('datahub-header-badge-button[label$=favorites] button').click({ + force: true, + }) }) it('only shows one record, same as the favorite one', () => { cy.get('gn-ui-results-list-item').should('have.length', 1) diff --git a/apps/datahub-e2e/src/e2e/organizations.cy.ts b/apps/datahub-e2e/src/e2e/organizations.cy.ts index e048363adf..9182f01df0 100644 --- a/apps/datahub-e2e/src/e2e/organizations.cy.ts +++ b/apps/datahub-e2e/src/e2e/organizations.cy.ts @@ -1,14 +1,8 @@ import 'cypress-real-events' -const getSortOptions = () => { - cy.get('gn-ui-organisations-sort').find('gn-ui-dropdown-selector').click() - return cy.get('.cdk-overlay-container').find('[role=listbox]') -} - describe('organizations', () => { beforeEach(() => { cy.visit('/home/organisations') - cy.viewport(1700, 1200) // aliases cy.get('gn-ui-organisations-sort') diff --git a/apps/datahub-e2e/src/support/commands.ts b/apps/datahub-e2e/src/support/commands.ts index fe5324d604..0f1151b769 100644 --- a/apps/datahub-e2e/src/support/commands.ts +++ b/apps/datahub-e2e/src/support/commands.ts @@ -29,7 +29,7 @@ Cypress.Commands.add('login', () => { if (err.message.includes('postMessage')) return false }) - cy.visit('/geonetwork/srv/eng/catalog.signin?debug') + cy.visit('/geonetwork/srv/eng/catalog.signin?debug&redirect=blargz') // this will point to a 404 cy.get('#inputUsername').type('admin', { force: true }) cy.get('#inputPassword').type('admin', { force: true }) cy.get('[name="gnSigninForm"]').submit() diff --git a/apps/datahub-e2e/src/support/e2e.ts b/apps/datahub-e2e/src/support/e2e.ts index 185d654ec6..af7675e3f8 100644 --- a/apps/datahub-e2e/src/support/e2e.ts +++ b/apps/datahub-e2e/src/support/e2e.ts @@ -15,3 +15,7 @@ // Import commands.js using ES2015 syntax: import './commands' + +beforeEach(() => { + cy.viewport(1900, 1400) +})