From d282562b0b99b5593cd6bd3038825be7f5d4b3b6 Mon Sep 17 00:00:00 2001 From: Goel Biju Date: Fri, 3 Sep 2021 15:53:59 +0100 Subject: [PATCH] Correct page view button in e2e tests (#772) --- .../cypress/integration/card/datasets.spec.ts | 8 +++++--- .../cypress/integration/card/dls/datasets.spec.ts | 8 +++++--- .../cypress/integration/card/dls/proposals.spec.ts | 2 +- .../cypress/integration/card/dls/visits.spec.ts | 2 +- .../cypress/integration/card/investigations.spec.ts | 2 +- .../cypress/integration/card/isis/datasets.spec.ts | 8 +++++--- .../cypress/integration/card/isis/instruments.spec.ts | 2 +- .../cypress/integration/card/isis/investigations.spec.ts | 2 +- .../cypress/integration/card/isis/studies.spec.ts | 2 +- .../cypress/integration/card/pageContainer.spec.ts | 2 +- .../cypress/integration/table/pageContainer.spec.ts | 2 +- 11 files changed, 23 insertions(+), 17 deletions(-) diff --git a/packages/datagateway-dataview/cypress/integration/card/datasets.spec.ts b/packages/datagateway-dataview/cypress/integration/card/datasets.spec.ts index c906a653b..d1c0f7926 100644 --- a/packages/datagateway-dataview/cypress/integration/card/datasets.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/datasets.spec.ts @@ -7,9 +7,11 @@ describe('Datasets Cards', () => { ['@getDatasetsCount', '@getDatasetsOrder', '@getDatasetsOrder'], { timeout: 10000 } ); - cy.get('[aria-label="page-view"]').click().wait(['@getDatasetsOrder'], { - timeout: 10000, - }); + cy.get('[aria-label="page-view Display as cards"]') + .click() + .wait(['@getDatasetsOrder'], { + timeout: 10000, + }); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/dls/datasets.spec.ts b/packages/datagateway-dataview/cypress/integration/card/dls/datasets.spec.ts index e48014dd5..ed219882b 100644 --- a/packages/datagateway-dataview/cypress/integration/card/dls/datasets.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/dls/datasets.spec.ts @@ -9,9 +9,11 @@ describe('DLS - Datasets Cards', () => { timeout: 10000, } ); - cy.get('[aria-label="page-view"]').click().wait(['@getDatasetsOrder'], { - timeout: 10000, - }); + cy.get('[aria-label="page-view Display as cards"]') + .click() + .wait(['@getDatasetsOrder'], { + timeout: 10000, + }); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/dls/proposals.spec.ts b/packages/datagateway-dataview/cypress/integration/card/dls/proposals.spec.ts index e8b0a4181..730d79efd 100644 --- a/packages/datagateway-dataview/cypress/integration/card/dls/proposals.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/dls/proposals.spec.ts @@ -8,7 +8,7 @@ describe('DLS - Proposals Cards', () => { ['@getInvestigationsCount', '@getInvestigationsOrder'], { timeout: 10000 } ); - cy.get('[aria-label="page-view"]') + cy.get('[aria-label="page-view Display as cards"]') .click() .wait(['@getInvestigationsOrder'], { timeout: 10000, diff --git a/packages/datagateway-dataview/cypress/integration/card/dls/visits.spec.ts b/packages/datagateway-dataview/cypress/integration/card/dls/visits.spec.ts index 5926a16f2..1e6770464 100644 --- a/packages/datagateway-dataview/cypress/integration/card/dls/visits.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/dls/visits.spec.ts @@ -8,7 +8,7 @@ describe('DLS - Visits Cards', () => { ['@getInvestigationsCount', '@getInvestigationsOrder'], { timeout: 10000 } ); - cy.get('[aria-label="page-view"]') + cy.get('[aria-label="page-view Display as cards"]') .click() .wait(['@getInvestigationsOrder'], { timeout: 10000, diff --git a/packages/datagateway-dataview/cypress/integration/card/investigations.spec.ts b/packages/datagateway-dataview/cypress/integration/card/investigations.spec.ts index 942e1b9c9..ffb166d03 100644 --- a/packages/datagateway-dataview/cypress/integration/card/investigations.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/investigations.spec.ts @@ -12,7 +12,7 @@ describe('Investigations Cards', () => { ], { timeout: 15000 } ); - cy.get('[aria-label="page-view"]').click(); + cy.get('[aria-label="page-view Display as cards"]').click(); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/isis/datasets.spec.ts b/packages/datagateway-dataview/cypress/integration/card/isis/datasets.spec.ts index aeb4adbe7..493a87cda 100644 --- a/packages/datagateway-dataview/cypress/integration/card/isis/datasets.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/isis/datasets.spec.ts @@ -8,9 +8,11 @@ describe('ISIS - Datasets Cards', () => { ).wait(['@getDatasetsCount', '@getDatasetsOrder', '@getDatasetsOrder'], { timeout: 10000, }); - cy.get('[aria-label="page-view"]').click().wait(['@getDatasetsOrder'], { - timeout: 10000, - }); + cy.get('[aria-label="page-view Display as cards"]') + .click() + .wait(['@getDatasetsOrder'], { + timeout: 10000, + }); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/isis/instruments.spec.ts b/packages/datagateway-dataview/cypress/integration/card/isis/instruments.spec.ts index d1a0a93ff..b61838e54 100644 --- a/packages/datagateway-dataview/cypress/integration/card/isis/instruments.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/isis/instruments.spec.ts @@ -8,7 +8,7 @@ describe('ISIS - Instruments Cards', () => { ['@getInstrumentsCount', '@getInstrumentsOrder'], { timeout: 10000 } ); - cy.get('[aria-label="page-view"]').click(); + cy.get('[aria-label="page-view Display as cards"]').click(); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/isis/investigations.spec.ts b/packages/datagateway-dataview/cypress/integration/card/isis/investigations.spec.ts index 4095746ee..6271b618f 100644 --- a/packages/datagateway-dataview/cypress/integration/card/isis/investigations.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/isis/investigations.spec.ts @@ -8,7 +8,7 @@ describe('ISIS - Investigations Cards', () => { ['@getInvestigationsCount', '@getInvestigationsOrder'], { timeout: 10000 } ); - cy.get('[aria-label="page-view"]').click(); + cy.get('[aria-label="page-view Display as cards"]').click(); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/isis/studies.spec.ts b/packages/datagateway-dataview/cypress/integration/card/isis/studies.spec.ts index 71dce7125..8b48db1f6 100644 --- a/packages/datagateway-dataview/cypress/integration/card/isis/studies.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/isis/studies.spec.ts @@ -7,7 +7,7 @@ describe('ISIS - Studies Cards', () => { ['@getStudiesCount', '@getStudiesOrder'], { timeout: 10000 } ); - cy.get('[aria-label="page-view"]').click(); + cy.get('[aria-label="page-view Display as cards"]').click(); }); it('should load correctly', () => { diff --git a/packages/datagateway-dataview/cypress/integration/card/pageContainer.spec.ts b/packages/datagateway-dataview/cypress/integration/card/pageContainer.spec.ts index f69e57167..a636449b0 100644 --- a/packages/datagateway-dataview/cypress/integration/card/pageContainer.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/card/pageContainer.spec.ts @@ -27,7 +27,7 @@ describe('PageContainer Component', () => { cy.get('[aria-label="view-cart"]').should('exist'); - cy.get('[aria-label="page-view"]').should('exist'); + cy.get('[aria-label="page-view Display as cards"]').should('exist'); }); it('should display correct entity count', () => { diff --git a/packages/datagateway-dataview/cypress/integration/table/pageContainer.spec.ts b/packages/datagateway-dataview/cypress/integration/table/pageContainer.spec.ts index 3ee43e0af..853c3e3a5 100644 --- a/packages/datagateway-dataview/cypress/integration/table/pageContainer.spec.ts +++ b/packages/datagateway-dataview/cypress/integration/table/pageContainer.spec.ts @@ -16,7 +16,7 @@ describe('PageContainer Component', () => { cy.get('[aria-label="view-cart"]').should('exist'); - cy.get('[aria-label="page-view"]').should('exist'); + cy.get('[aria-label="page-view Display as cards"]').should('exist'); }); it('should display correct entity count', () => {