From 1393cf284cc236785daf7987058ac3ea3e54714d Mon Sep 17 00:00:00 2001 From: Kacper Roemer Date: Thu, 31 Aug 2023 09:24:38 +0100 Subject: [PATCH] fixed dataview e2e tests #1562 --- .../datagateway-dataview/cypress/e2e/table/datafiles.cy.ts | 3 +++ .../datagateway-dataview/cypress/e2e/table/datasets.cy.ts | 2 ++ .../cypress/e2e/adminDownloadStatus.cy.ts | 5 ++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/datagateway-dataview/cypress/e2e/table/datafiles.cy.ts b/packages/datagateway-dataview/cypress/e2e/table/datafiles.cy.ts index f22a37247..635b0b4ec 100644 --- a/packages/datagateway-dataview/cypress/e2e/table/datafiles.cy.ts +++ b/packages/datagateway-dataview/cypress/e2e/table/datafiles.cy.ts @@ -123,6 +123,9 @@ describe('Datafiles Table', () => { cy.get('.MuiPickersCalendarHeader-label').click(); cy.contains('2020').click(); + // A weird bug where the calendar jumps out from under the cursor on first click + // second click works fine + cy.get('.MuiPickersDay-root[type="button"]').first().click(); cy.get('.MuiPickersDay-root[type="button"]').first().click(); cy.get('input[id="Modified Time filter to"]').should( diff --git a/packages/datagateway-dataview/cypress/e2e/table/datasets.cy.ts b/packages/datagateway-dataview/cypress/e2e/table/datasets.cy.ts index 2b0dd0fd6..31478f904 100644 --- a/packages/datagateway-dataview/cypress/e2e/table/datasets.cy.ts +++ b/packages/datagateway-dataview/cypress/e2e/table/datasets.cy.ts @@ -95,6 +95,8 @@ describe('Datasets Table', () => { cy.get('.MuiPickersCalendarHeader-label').click(); cy.contains('2020').click(); + // same bug with moving calendar as in datafiles.cy.ts + cy.get('.MuiPickersDay-root[type="button"]').first().click(); cy.get('.MuiPickersDay-root[type="button"]').first().click(); cy.get('input[id="Create Time filter to"]').should( diff --git a/packages/datagateway-download/cypress/e2e/adminDownloadStatus.cy.ts b/packages/datagateway-download/cypress/e2e/adminDownloadStatus.cy.ts index e59734e2f..270dcad09 100644 --- a/packages/datagateway-download/cypress/e2e/adminDownloadStatus.cy.ts +++ b/packages/datagateway-download/cypress/e2e/adminDownloadStatus.cy.ts @@ -112,11 +112,10 @@ describe('Admin Download Status', () => { const toDate = new Date(now + 5000); cy.get('input[id="Requested Date filter from"]').type( - fromDate.toLocaleString('sv') + fromDate.toLocaleString('sv').split(' ').join('') ); - cy.get('input[id="Requested Date filter to"]').type( - toDate.toLocaleString('sv') + toDate.toLocaleString('sv').split(' ').join('') ); cy.get('@initialRowCount').then((initialRowCount) => {