Skip to content

Commit

Permalink
#1152 - fix cypress warnings in new e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louise-davies committed Sep 13, 2023
1 parent 7ed1118 commit 1547842
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ describe('Datafile search tab', () => {
cy.findAllByRole('row')
.eq(1)
.within(() => {
cy.findByRole('checkbox').click().should('be.checked');
cy.findByRole('checkbox').click();
cy.findByRole('checkbox').should('be.checked');
});

cy.intercept(`**/topcat/user/cart/${facilityName}/cartItems`, {
Expand All @@ -128,7 +129,8 @@ describe('Datafile search tab', () => {
cy.findAllByRole('row')
.eq(1)
.within(() => {
cy.findByRole('checkbox').click().should('not.be.checked');
cy.findByRole('checkbox').click();
cy.findByRole('checkbox').should('not.be.checked');
});
});

Expand Down Expand Up @@ -176,11 +178,12 @@ describe('Datafile search tab', () => {
.within(() => {
cy.findByRole('button', {
name: 'Add isis neutron raw filter',
})
.click()
.within(() => {
cy.findByRole('checkbox').should('be.checked');
});
}).click();
cy.findByRole('button', {
name: 'Add isis neutron raw filter',
}).within(() => {
cy.findByRole('checkbox').should('be.checked');
});
});

// intercept search request to return predefined filtered search result
Expand Down
17 changes: 10 additions & 7 deletions packages/datagateway-search/cypress/e2e/search/datasetSearch.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ describe('Dataset search tab', () => {
cy.findAllByRole('row')
.eq(1)
.within(() => {
cy.findByRole('checkbox').click().should('be.checked');
cy.findByRole('checkbox').click();
cy.findByRole('checkbox').should('be.checked');
});

cy.intercept(`**/topcat/user/cart/${facilityName}/cartItems`, {
Expand All @@ -121,7 +122,8 @@ describe('Dataset search tab', () => {
cy.findAllByRole('row')
.eq(1)
.within(() => {
cy.findByRole('checkbox').click().should('not.be.checked');
cy.findByRole('checkbox').click();
cy.findByRole('checkbox').should('not.be.checked');
});
});

Expand All @@ -144,11 +146,12 @@ describe('Dataset search tab', () => {
.within(() => {
cy.findByRole('button', {
name: 'Add experiment_raw filter',
})
.click()
.within(() => {
cy.findByRole('checkbox').should('be.checked');
});
}).click();
cy.findByRole('button', {
name: 'Add experiment_raw filter',
}).within(() => {
cy.findByRole('checkbox').should('be.checked');
});
});

// intercept search request to return predefined filtered search result
Expand Down

0 comments on commit 1547842

Please sign in to comment.