Skip to content

Commit

Permalink
ISIS e2e test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
akintomiwa committed Aug 23, 2024
1 parent 29633ba commit 6c0c3c1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ describe('ISIS - Datasets Cards', () => {
cy.get('#datagateway-dataview').should('be.visible');

//Default sort
cy.contains('[role="button"]', 'desc').should('exist');
cy.get('.MuiTableSortLabel-iconDirectionDesc').should('be.visible');
cy.contains('[role="button"]', 'asc').should('exist');
cy.get('.MuiTableSortLabel-iconDirectionAsc').should('be.visible');
});

it('should be able to click a dataset to see its datafiles', () => {
cy.get('[data-testid="card"]')
.first()
.contains('DATASET 79')
.contains('DATASET 19')
.click({ force: true });
cy.location('pathname').should(
'eq',
'/browse/instrument/1/facilityCycle/19/investigation/19/dataset/79'
'/browse/instrument/1/facilityCycle/19/investigation/19/dataset/19'
);
});

Expand Down Expand Up @@ -62,9 +62,7 @@ describe('ISIS - Datasets Cards', () => {

// ascending
cy.contains('[role="button"]', 'Name').as('nameSortButton').click();
cy.wait('@getDatasetsOrder', {
timeout: 10000,
});

cy.contains('[role="button"]', 'asc').should('exist');
cy.contains('[role="button"]', 'desc').should('not.exist');
cy.get('[data-testid="card"]').first().contains('DATASET 19');
Expand Down Expand Up @@ -144,4 +142,4 @@ describe('ISIS - Datasets Cards', () => {
);
cy.get('[data-testid="card"]').should('not.exist');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ describe('ISIS - Datafiles Table', () => {
cy.get('#datagateway-dataview').should('be.visible');

//Default sort
cy.get('[aria-sort="descending"]').should('exist');
cy.get('.MuiTableSortLabel-iconDirectionDesc').should('be.visible');
cy.get('[aria-sort="ascending"]').should('exist');
cy.get('.MuiTableSortLabel-iconDirectionAsc').should('be.visible');
});

it('should not load incorrect URL', () => {
Expand Down Expand Up @@ -120,6 +120,8 @@ describe('ISIS - Datafiles Table', () => {
it('should change icons when sorting on a column', () => {
// clear default sort
cy.contains('[role="button"]', 'Modified Time').click();
cy.contains('[role="button"]', 'Modified Time').click();
cy.contains('[role="button"]', 'Modified Time').click();

cy.get('[data-testid="SortIcon"]').should('have.length', 4);

Expand Down Expand Up @@ -165,30 +167,30 @@ describe('ISIS - Datafiles Table', () => {
cy.get('[aria-label="Show details"]').eq(1).click();

cy.get('#details-panel').should('be.visible');
cy.get('#details-panel').contains('Datafile 1625').should('be.visible');
cy.get('#details-panel').contains('Datafile 1149').should('be.visible');
cy.get('[aria-label="Hide details"]').should('exist');

cy.get('[aria-label="Show details"]').first().click();

cy.get('#details-panel').contains('Datafile 1744').should('be.visible');
cy.get('#details-panel').contains('Datafile 1625').should('not.exist');
cy.get('#details-panel').contains('Datafile 1030').should('be.visible');
cy.get('#details-panel').contains('Datafile 1149').should('not.exist');
cy.get('[aria-label="Hide details"]').should('have.length', 1);

cy.get('[aria-controls="datafile-details-panel"]').should('be.visible');

cy.get('#details-panel')
.contains('Doctor involve recently treat')
.contains('See American arm college policy')
.should('be.visible');

cy.get('[aria-controls="datafile-parameters-panel"]').should('be.visible');
cy.get('[aria-controls="datafile-parameters-panel"]').click();

cy.get('#parameter-grid').should('be.visible');
cy.get('#details-panel').contains('PARAMETERTYPE 11').should('be.visible');
cy.get('#details-panel').contains('PARAMETERTYPE 18').should('be.visible');

cy.get('[aria-label="Hide details"]').first().click();

cy.get('#details-panel').should('not.exist');
cy.get('[aria-label="Hide details"]').should('not.exist');
});
});
});
27 changes: 11 additions & 16 deletions packages/datagateway-dataview/cypress/e2e/table/isis/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('ISIS - Datasets Table', () => {
});
// Check that we have received the size from the API as this will produce
// a re-render which can prevent some interactions.
cy.contains('[aria-rowindex="1"] [aria-colindex="4"]', '1.36 GB').should(
cy.contains('[aria-rowindex="1"] [aria-colindex="4"]', '1.47 GB').should(
'exist'
);
});
Expand All @@ -20,13 +20,12 @@ describe('ISIS - Datasets Table', () => {
cy.get('#datagateway-dataview').should('be.visible');

//Default sort
cy.get('[aria-sort="descending"]').should('exist');
cy.get('.MuiTableSortLabel-iconDirectionDesc').should('be.visible');
cy.get('[aria-sort="ascending"]').should('exist');
cy.get('.MuiTableSortLabel-iconDirectionAsc').should('be.visible');
});

it('should not load incorrect URL', () => {
cy.visit('/browse/instrument/2/facilityCycle/15/investigation/87/dataset');

cy.contains('Oops!').should('be.visible');
cy.get('[role="grid"]').should('not.exist');
});
Expand All @@ -36,7 +35,7 @@ describe('ISIS - Datasets Table', () => {

cy.location('pathname').should(
'eq',
'/browse/instrument/1/facilityCycle/19/investigation/19/dataset/79'
'/browse/instrument/1/facilityCycle/19/investigation/19/dataset/19'
);
});

Expand Down Expand Up @@ -164,27 +163,23 @@ describe('ISIS - Datasets Table', () => {

cy.get('#details-panel').should('be.visible');
cy.get('[aria-label="Hide details"]').should('exist');
cy.get('#details-panel').contains('DATASET 19').should('be.visible');
cy.get('#details-panel').contains('DATASET 79').should('be.visible');

cy.get('[aria-label="Show details"]').first().click();

cy.get('#details-panel').contains('DATASET 79').should('be.visible');
cy.get('#details-panel').contains('DATASET 19').should('not.exist');
cy.get('#details-panel').contains('DATASET 19').should('be.visible');
cy.get('#details-panel').contains('DATASET 79').should('not.exist');
cy.get('[aria-label="Hide details"]').should('have.length', 1);

cy.get('#details-panel')
.contains(
'Example early fight chance culture fill either collection. Someone similar space few should lawyer various quite. Page discuss so music worker lawyer'
)
.contains('Night out whether mouth participant chance')
.should('be.visible');

cy.get('[aria-controls="dataset-type-panel"]').should('be.visible');
cy.get('[aria-controls="dataset-type-panel"]').click();

cy.get('#details-panel')
.contains(
'Stop prove field onto think suffer measure. Table lose season identify professor happen third simply.'
)
.contains('Suggest shake effort many last prepare small')
.should('be.visible');

cy.get('[aria-label="Hide details"]').first().click();
Expand All @@ -199,8 +194,8 @@ describe('ISIS - Datasets Table', () => {

cy.location('pathname').should(
'eq',
'/browse/instrument/1/facilityCycle/19/investigation/19/dataset/79/datafile'
'/browse/instrument/1/facilityCycle/19/investigation/19/dataset/19/datafile'
);
});
});
});
});

0 comments on commit 6c0c3c1

Please sign in to comment.