-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from codytodonnell/feature/tests
Add UI test suite
- Loading branch information
Showing
18 changed files
with
163 additions
and
33 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
strudel-taskflows/src/pages/compare-data/_tests/compare-data.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
describe('The Compare Data Task Flow', () => { | ||
beforeEach(() => { | ||
cy.visit('/compare-data'); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.get('h1').contains('Compare Data') | ||
}); | ||
|
||
it('selects two rows and compares them', () => { | ||
cy.get('.MuiCheckbox-root').eq(1).click(); | ||
cy.get('button[data-testid="cpd-compare-button"]').should('be.disabled') | ||
cy.get('.MuiCheckbox-root').eq(2).click(); | ||
cy.get('button[data-testid="cpd-compare-button"]') | ||
.contains('Compare Scenarios (2)', { matchCase: false }) | ||
.click(); | ||
cy.get('.MuiDataGrid-columnHeader').should('have.length', 3) | ||
}); | ||
|
||
it('opens the new item page and closes it', () => { | ||
cy.get('button[data-testid="cpd-new-button"]').click(); | ||
cy.get('button[data-testid="cpd-cancel-button"]'); | ||
cy.get('button[data-testid="cpd-save-button"]').click(); | ||
cy.get('button[data-testid="cpd-compare-button"]'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
strudel-taskflows/src/pages/contribute-data/_tests/contribute-data.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
describe('The Contribute Data Task Flow', () => { | ||
beforeEach(() => { | ||
cy.visit('/contribute-data'); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.get('h1').contains('Register') | ||
}); | ||
|
||
it('publishes a new dataset', () => { | ||
cy.get('button[data-testid="ctd-submit-button"]').click(); | ||
cy.get('button[data-testid="ctd-new-button"]').click(); | ||
cy.get('h2').first().contains('Metadata'); | ||
cy.get('h2').eq(1).contains('Dataset Files'); | ||
cy.get('button[data-testid="ctd-save-button"]').click(); | ||
cy.get('.MuiAlert-colorSuccess'); | ||
cy.get('h2').should('have.length', 2); | ||
cy.get('button[data-testid="ctd-checks-button"]').click(); | ||
cy.wait(6000); | ||
cy.get('button[data-testid="ctd-publish-button"]').click(); | ||
cy.get('button[data-testid="ctd-new-button"]'); | ||
}); | ||
|
||
it('edits and cancels a dataset', () => { | ||
cy.get('button[data-testid="ctd-submit-button"]').click(); | ||
cy.get('button[data-testid="ctd-new-button"]').click(); | ||
cy.get('button[data-testid="ctd-save-button"]').click(); | ||
cy.get('button[data-testid="ctd-edit-button"]').click(); | ||
cy.get('button[data-testid="ctd-cancel-button"]').click(); | ||
cy.get('button[data-testid="ctd-new-button"]'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
strudel-taskflows/src/pages/monitor-activities/_tests/monitor-activities.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
describe('The Monitor Activities Task Flow', () => { | ||
beforeEach(() => { | ||
cy.visit('/monitor-activities'); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.get('h1').contains('Experiments') | ||
}); | ||
|
||
it('drills into a row and shows details', () => { | ||
cy.get('.MuiDataGrid-columnHeader').should('have.length', 4); | ||
cy.get('.MuiDataGrid-row').eq(1).click(); | ||
cy.get('button[data-testid="mna-back-button"]'); | ||
cy.get('.MuiDataGrid-columnHeader').should('have.length', 3); | ||
cy.get('h2').contains('Notes'); | ||
cy.get('.js-plotly-plot'); | ||
|
||
}); | ||
|
||
it('drills into a row and goes back', () => { | ||
cy.get('.MuiDataGrid-row').eq(1).click(); | ||
cy.get('button[data-testid="mna-back-button"]').click(); | ||
cy.get('.MuiDataGrid-columnHeader').should('have.length', 4); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
strudel-taskflows/src/pages/run-computation/_tests/run-computation.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
describe('The Run Computation Task Flow', () => { | ||
beforeEach(() => { | ||
cy.visit('/run-computation'); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.get('h1').contains('Scenario List') | ||
}); | ||
|
||
it('runs a new computation', () => { | ||
cy.get('button[data-testid="rnc-new-button"]').click(); | ||
cy.get('button[data-testid="rnc-create-button"]').click(); | ||
cy.get('.MuiStepLabel-label').first().should('have.class', 'Mui-active'); | ||
cy.get('.MuiStepLabel-label').eq(1).should('have.class', 'Mui-disabled'); | ||
cy.get('.MuiStepLabel-label').eq(2).should('have.class', 'Mui-disabled'); | ||
cy.get('button[data-testid="rnc-settings-next-button"]').click(); | ||
cy.get('button[data-testid="rnc-run-button"]').click(); | ||
cy.get('h2').contains('Running'); | ||
cy.get('.MuiStepLabel-label').first().should('have.class', 'Mui-completed'); | ||
cy.get('.MuiStepLabel-label').eq(1).should('have.class', 'Mui-active'); | ||
cy.get('.MuiStepLabel-label').eq(2).should('have.class', 'Mui-disabled'); | ||
cy.wait(5000); | ||
cy.get('button[data-testid="rnc-results-button"]').click(); | ||
cy.get('.MuiStepLabel-label').first().should('have.class', 'Mui-completed'); | ||
cy.get('.MuiStepLabel-label').eq(1).should('have.class', 'Mui-completed'); | ||
cy.get('.MuiStepLabel-label').eq(2).should('have.class', 'Mui-active'); | ||
cy.get('.js-plotly-plot').should('have.length', 2); | ||
}); | ||
|
||
it('goes back to the scenario list', () => { | ||
cy.get('button[data-testid="rnc-new-button"]').click(); | ||
cy.get('button[data-testid="rnc-create-button"]').click(); | ||
cy.get('.MuiStepLabel-label').first().should('have.class', 'Mui-active'); | ||
cy.get('.MuiStepLabel-label').eq(1).should('have.class', 'Mui-disabled'); | ||
cy.get('.MuiStepLabel-label').eq(2).should('have.class', 'Mui-disabled'); | ||
cy.get('a[data-testid="rnc-list-link"]').click(); | ||
cy.get('button[data-testid="rnc-new-button"]'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters