-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pagination_test command Signed-off-by: Milouu <milan.roustan@owkin.com> * Add open filters command Signed-off-by: Milouu <milan.roustan@owkin.com> * Add commands & functions tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add log feature to config Signed-off-by: Milouu <milan.roustan@owkin.com> * change scripts name Signed-off-by: Milouu <milan.roustan@owkin.com> * delete fixture example file Signed-off-by: Milouu <milan.roustan@owkin.com> * add cypress commands Signed-off-by: Milouu <milan.roustan@owkin.com> * add functions tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add users page test to menu tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add cps tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add cp details tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add datasets tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add tasks tests Signed-off-by: Milouu <milan.roustan@owkin.com> * add support function Signed-off-by: Milouu <milan.roustan@owkin.com> * update changelog Signed-off-by: Milouu <milan.roustan@owkin.com> * Add comments to commands file Signed-off-by: Milouu <milan.roustan@owkin.com> * Increase retries for CI testing Signed-off-by: Milouu <milan.roustan@owkin.com> * Fix misc tests Signed-off-by: Milouu <milan.roustan@owkin.com> * Add permissions conditions to download function test Signed-off-by: Milouu <milan.roustan@owkin.com> * intercept test Signed-off-by: Milouu <milan.roustan@owkin.com> * Clean PR Signed-off-by: Milouu <milan.roustan@owkin.com> * remove intercept Signed-off-by: Milouu <milan.roustan@owkin.com> * skip download function test Signed-off-by: Milouu <milan.roustan@owkin.com> * Remove skipped test Signed-off-by: Milouu <milan.roustan@owkin.com> * add favorite test in cp details Signed-off-by: Milouu <milan.roustan@owkin.com> * Add performance test in cp details Signed-off-by: Milouu <milan.roustan@owkin.com> * Add searchbykey test for functions & datasets Signed-off-by: Milouu <milan.roustan@owkin.com> * Add CRUD tests for users page Signed-off-by: Milouu <milan.roustan@owkin.com> * style(src): run prettier Signed-off-by: Thibault Camalon <135698225+thbcmlowk@users.noreply.github.com> * fix: Wait before checking change on user role Signed-off-by: Milouu <milan.roustan@owkin.com> * fix: replace wait by built-in retry process Signed-off-by: Milouu <milan.roustan@owkin.com> --------- Signed-off-by: Milouu <milan.roustan@owkin.com> Signed-off-by: Thibault Camalon <135698225+thbcmlowk@users.noreply.github.com> Co-authored-by: Thibault Camalon <135698225+thbcmlowk@users.noreply.github.com>
- Loading branch information
Showing
44 changed files
with
476 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
describe('Compute plans page', () => { | ||
before(() => { | ||
cy.login(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit('/compute_plans'); | ||
cy.get('tbody[data-cy=loaded]').get('tr').eq(1).click({ force: true }); | ||
}); | ||
|
||
it('navigates to the dedicated compute plan page', () => { | ||
cy.url().should('match', /compute_plans\/.{36}\/tasks/); | ||
}); | ||
|
||
it('adds cp to favorites', () => { | ||
cy.getDataCy('favorite-cp').should('not.exist'); | ||
cy.getDataCy('favorite-box').first().click(); | ||
cy.getDataCy('favorite-cp').should('exist'); | ||
}); | ||
|
||
it('task drawer shows performance', () => { | ||
cy.getDataCy('task-with-performance') | ||
.should('have.length.gte', 0) | ||
.then(($hits) => { | ||
if ($hits.length > 0) { | ||
cy.getDataCy('task-with-performance').first().click(); | ||
cy.getDataCy('output-performance').should('exist'); | ||
} | ||
}); | ||
}); | ||
|
||
it('navigates to the Workflow page', () => { | ||
cy.getDataCy('Workflow-tab').click({ force: true }); | ||
cy.url().should('match', /compute_plans\/.{36}\/workflow/); | ||
cy.getDataCy('workflow-graph').should('exist'); | ||
}); | ||
|
||
it('navigates to the Detail page', () => { | ||
cy.getDataCy('Details-tab').click({ force: true }); | ||
cy.url().should('match', /compute_plans\/.{36}\/tasks/); | ||
}); | ||
|
||
it('navigates to the Performance page', () => { | ||
cy.getDataCy('Performances-tab').click({ force: true }); | ||
cy.url().should('match', /compute_plans\/.{36}\/chart/); | ||
cy.getDataCy('cp-chart').should('exist'); | ||
}); | ||
|
||
it('clicks on perf card to display perf details', () => { | ||
cy.getDataCy('Performances-tab').click({ force: true }); | ||
cy.getDataCy('perf-list').should('exist'); | ||
cy.getDataCy('perf-card').first().click(); | ||
cy.getDataCy('perf-details').should('exist'); | ||
}); | ||
|
||
it('can download perf details as jpeg or csv', () => { | ||
cy.getDataCy('Performances-tab').click({ force: true }); | ||
cy.getDataCy('perf-card').first().click(); | ||
cy.get('[data-cpkey]') | ||
.invoke('data', 'cpkey') | ||
.then((key) => { | ||
cy.getDataCy('download-button').click(); | ||
cy.getDataCy('download-as-jpeg').click(); | ||
cy.checkDownloadedFile(`cp_${key}.jpeg`); | ||
cy.getDataCy('download-button').click(); | ||
cy.getDataCy('download-as-csv').click(); | ||
cy.checkDownloadedFile(`${key}.csv`); | ||
}); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
describe('Users page', () => { | ||
before(() => { | ||
cy.login(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit('/compute_plans'); | ||
cy.getDataCy('menu-button').click(); | ||
cy.get('[data-user-role]') | ||
.invoke('data', 'user-role') | ||
.then((userRole) => { | ||
if (userRole === 'ADMIN') { | ||
cy.visit('/users'); | ||
} | ||
}); | ||
}); | ||
|
||
it('can create user', () => { | ||
cy.getDataCy('create-user').click(); | ||
cy.getDataCy('username-input').type('Test'); | ||
cy.getDataCy('password-input').type('Azertyuiop123456789$'); | ||
cy.getDataCy('submit-form').click(); | ||
|
||
cy.get('[data-name="Test"]').first().should('exist'); | ||
}); | ||
|
||
it('can update user', () => { | ||
cy.get('[data-name="Test"]') | ||
.first() | ||
.should('exist') | ||
.then(($el) => { | ||
cy.wrap($el).should('have.data', 'role', 'USER'); | ||
cy.wrap($el).click(); | ||
}); | ||
cy.get('select').eq(0).select('ADMIN'); | ||
cy.getDataCy('submit-form').click(); | ||
|
||
cy.get('[data-name="Test"]') | ||
.first() | ||
.should(($el) => { | ||
expect($el).to.have.data('role', 'ADMIN'); | ||
}); | ||
}); | ||
|
||
it('can delete user', () => { | ||
cy.get('[data-name="Test"]').first().click(); | ||
cy.getDataCy('delete-user').click(); | ||
cy.getDataCy('confirm-delete').click(); | ||
cy.get('[data-name="Test"]').should('not.exist'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.