Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Data Publications e2e Test #1580

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
with:
repository: ral-facilities/datagateway-api
path: datagateway-api
ref: v7.1.0
ref: v9.0.1

# DataGateway API file setup
- name: Create search_api_mapping.json
Expand Down Expand Up @@ -288,7 +288,7 @@ jobs:
with:
repository: ral-facilities/datagateway-api
path: datagateway-api
ref: v7.1.0
ref: v9.0.1

# DataGateway API file setup
- name: Create search_api_mapping.json
Expand Down Expand Up @@ -418,7 +418,7 @@ jobs:
with:
repository: ral-facilities/datagateway-api
path: datagateway-api
ref: v7.1.0
ref: v9.0.1

# DataGateway API file setup
- name: Create search_api_mapping.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
Loading