From 2526c3053b553898bb2ef645b10cae6698a45697 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 6 Sep 2023 09:26:07 +0100 Subject: [PATCH 1/3] Clean up data publications e2e test --- .../e2e/table/isis/dataPublications.cy.ts | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/packages/datagateway-dataview/cypress/e2e/table/isis/dataPublications.cy.ts b/packages/datagateway-dataview/cypress/e2e/table/isis/dataPublications.cy.ts index 89b934715..e997bea4f 100644 --- a/packages/datagateway-dataview/cypress/e2e/table/isis/dataPublications.cy.ts +++ b/packages/datagateway-dataview/cypress/e2e/table/isis/dataPublications.cy.ts @@ -110,41 +110,15 @@ describe('ISIS - Data Publication Table', () => { 'Church child time Congress' ); - let toDate = '2016-01-01'; - let fromDate = '2014-01-01'; - // TODO: make this less scuffed when https://github.com/ral-facilities/datagateway-api/issues/444 is fixed - if (Cypress.env('CI')) { - // can get the below date by looking at the createTime of any datafiles on SG preprod - const sgPreprodGenerationDate = new Date('2023-03-28'); - // get rid of any timezone offset - sgPreprodGenerationDate.setHours(0); - const today = new Date(); - today.setHours(0); - today.setMinutes(0); - today.setSeconds(0); - today.setMilliseconds(0); - const diff = today.getTime() - sgPreprodGenerationDate.getTime(); - - const toDateDate = new Date(toDate); - toDateDate.setHours(0); - toDateDate.setTime(toDateDate.getTime() + diff); - toDate = toDateDate.toLocaleDateString('sv').split(' ')[0]; - - const fromDateDate = new Date(fromDate); - fromDateDate.setHours(0); - fromDateDate.setTime(fromDateDate.getTime() + diff); - fromDate = fromDateDate.toLocaleDateString('sv').split(' ')[0]; - } - // test date filter - cy.get('input[id="Publication Date filter to"]').type(toDate); + cy.get('input[id="Publication Date filter to"]').type('2016-01-01'); cy.get('[aria-rowcount="2"]').should('exist'); cy.get('[aria-rowindex="1"] [aria-colindex="1"]').contains( 'Consider author watch' ); - cy.get('input[id="Publication Date filter from"]').type(fromDate); + cy.get('input[id="Publication Date filter from"]').type('2014-01-01'); cy.get('[aria-rowcount="1"]').should('exist'); }); From e880e3aabdf79fb53e4a3f6ed5dada16ad129910 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 6 Sep 2023 09:26:55 +0100 Subject: [PATCH 2/3] Change DG API branch on CI - This is to test whether the data publications e2e test has been fixed by the changes in the generator script --- .github/workflows/ci-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 2e30ab974..6581cb687 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -140,7 +140,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: v7.1.0 + ref: bugfix/data-publication-dates-#444 # DataGateway API file setup - name: Create search_api_mapping.json @@ -288,7 +288,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: v7.1.0 + ref: bugfix/data-publication-dates-#444 # DataGateway API file setup - name: Create search_api_mapping.json @@ -418,7 +418,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: v7.1.0 + ref: bugfix/data-publication-dates-#444 # DataGateway API file setup - name: Create search_api_mapping.json From a8a6c925ee77a585170ec4d7a3bf70705fb4dc8b Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 7 Sep 2023 14:50:16 +0100 Subject: [PATCH 3/3] Pin DG API to latest version on CI --- .github/workflows/ci-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6581cb687..3880ded28 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -140,7 +140,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: bugfix/data-publication-dates-#444 + ref: v9.0.1 # DataGateway API file setup - name: Create search_api_mapping.json @@ -288,7 +288,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: bugfix/data-publication-dates-#444 + ref: v9.0.1 # DataGateway API file setup - name: Create search_api_mapping.json @@ -418,7 +418,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: bugfix/data-publication-dates-#444 + ref: v9.0.1 # DataGateway API file setup - name: Create search_api_mapping.json