diff --git a/apps/datahub-e2e/src/e2e/datasets.cy.ts b/apps/datahub-e2e/src/e2e/datasets.cy.ts index eb8f482d0..416d3cfe7 100644 --- a/apps/datahub-e2e/src/e2e/datasets.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasets.cy.ts @@ -52,27 +52,35 @@ describe('datasets', () => { }) describe('display of dataset previews', () => { - it('should display a logo for first and a placeholder for second result', () => { - cy.get('@sortBy').selectDropdownOption('desc,createDate') // this makes the order reliable - cy.get('@sampleResult') + it('should display a placeholder for first result and a logo for second result', () => { + cy.get('@sortBy').selectDropdownOption('desc,userSavedCount') // this makes the order reliable + cy.get('@results') + .first() .find('gn-ui-thumbnail') .children('div') .invoke('attr', 'data-cy-is-placeholder') - .should('equal', 'false') - cy.get('@sampleResult') + .should('equal', 'true') + cy.get('@results') + .first() .find('gn-ui-thumbnail') .find('img') .invoke('attr', 'src') - .should( - 'eql', - 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/records/9e1ea778-d0ce-4b49-90b7-37bc0e448300/attachments/test.png' - ) + .should('include', 'data:image/png') cy.get('@results') - .first() + .eq(1) .find('gn-ui-thumbnail') .children('div') .invoke('attr', 'data-cy-is-placeholder') - .should('equal', 'true') + .should('equal', 'false') + cy.get('@results') + .eq(1) + .find('gn-ui-thumbnail') + .find('img') + .invoke('attr', 'src') + .should( + 'eq', + 'https://www.geo2france.fr/public/vignettes_geonetwork/part_menage_5ans.jpg' + ) }) it('should display the title', () => { cy.get('@sampleResult')