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

feat: SJIP-1214 Refactor Cypress tests - Solve skip tests and split file tests #855

Merged
merged 2 commits into from
Feb 28, 2025
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
18 changes: 18 additions & 0 deletions cypress/e2e/CavaticaButton/PageDataExploration_1.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference types="cypress"/>
import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762');
cy.get('tr[data-row-key="HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz"] [type="checkbox"]').check({force: true});
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});

describe('Page Dashboard - Bouton Analyze in Cavatica (déconnecté)', () => {
it('Vérifier les informations affichées - Modal', () => {
cy.get('[class="ant-modal-confirm-body"]').contains('Connect to Cavatica').should('exist');
cy.get('[class="ant-modal-confirm-body"]').contains('In order to analyze your files you must first connect your Cavatica account. Once you are connected, you will be redirected back to this page.').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-default"]').contains('Cancel').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-primary"]').contains('Connect').should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,40 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
});

describe('Page Dashboard - Bouton Analyze in Cavatica (déconnecté)', () => {
beforeEach(() => {
cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz');
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});
cy.intercept('GET', '**/cavatica/authenticated', {
statusCode: 200,
body: {
"authenticated": true,
"expiration": 1722180513
},
}).as('cavaticaAuthenticated');
cy.intercept('GET', '**/cavatica2/v2/projects', {
statusCode: 200,
body: {
"href": "https://cavatica-api.sbgenomics.com/v2/projects?offset=0&limit=50",
"items": [
{
"href": "https://cavatica-api.sbgenomics.com/v2/projects/mock/cypress-project",
"id": "mock/cypress-project",
"name": "Cypress-Project",
"category": "PRIVATE",
"created_by": "mock",
"created_on": "2024-07-05T00:00:00Z",
"modified_on": "2024-07-05T00:00:00Z"
}
],
"links": []
},
}).as('cavaticaProjects');

it('Vérifier les informations affichées - Modal', () => {
cy.get('[class="ant-modal-confirm-body"]').contains('Connect to Cavatica').should('exist');
cy.get('[class="ant-modal-confirm-body"]').contains('In order to analyze your files you must first connect your Cavatica account. Once you are connected, you will be redirected back to this page.').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-default"]').contains('Cancel').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-primary"]').contains('Connect').should('exist');
});
cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762');
cy.wait('@cavaticaAuthenticated');
cy.wait('@cavaticaProjects');
cy.get('tr[data-row-key="HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz"] [type="checkbox"]').check({force: true});
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});

describe('Page Dashboard - Bouton Analyze in Cavatica (connecté)', () => {
beforeEach(() => {
cy.intercept('GET', '**/cavatica/authenticated', {
statusCode: 200,
body: {
"authenticated": true,
"expiration": 1722180513
},
}).as('cavaticaAuthenticated');
cy.intercept('GET', '**/cavatica2/v2/projects', {
statusCode: 200,
body: {
"href": "https://cavatica-api.sbgenomics.com/v2/projects?offset=0&limit=50",
"items": [
{
"href": "https://cavatica-api.sbgenomics.com/v2/projects/mock/cypress-project",
"id": "mock/cypress-project",
"name": "Cypress-Project",
"category": "PRIVATE",
"created_by": "mock",
"created_on": "2024-07-05T00:00:00Z",
"modified_on": "2024-07-05T00:00:00Z"
}
],
"links": []
},
}).as('cavaticaProjects');

cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz');
cy.wait('@cavaticaAuthenticated');
cy.wait('@cavaticaProjects');
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});

it('Vérifier les informations affichées - Modal', () => {
cy.get('[class="ant-modal-title"]').contains('Analyze in Cavatica').should('exist');
cy.get('[class="ant-modal-body"]').contains('Copy files to...').should('exist');
Expand Down
17 changes: 17 additions & 0 deletions cypress/e2e/CavaticaButton/PageFile_1.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// <reference types="cypress"/>
import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz');
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});

describe('Page Dashboard - Bouton Analyze in Cavatica (déconnecté)', () => {
it('Vérifier les informations affichées - Modal', () => {
cy.get('[class="ant-modal-confirm-body"]').contains('Connect to Cavatica').should('exist');
cy.get('[class="ant-modal-confirm-body"]').contains('In order to analyze your files you must first connect your Cavatica account. Once you are connected, you will be redirected back to this page.').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-default"]').contains('Cancel').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-primary"]').contains('Connect').should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,39 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
});

describe('Page Dashboard - Bouton Analyze in Cavatica (déconnecté)', () => {
beforeEach(() => {
cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762');
cy.get('tr[data-row-key="HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz"] [type="checkbox"]').check({force: true});
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});
cy.intercept('GET', '**/cavatica/authenticated', {
statusCode: 200,
body: {
"authenticated": true,
"expiration": 1722180513
},
}).as('cavaticaAuthenticated');
cy.intercept('GET', '**/cavatica2/v2/projects', {
statusCode: 200,
body: {
"href": "https://cavatica-api.sbgenomics.com/v2/projects?offset=0&limit=50",
"items": [
{
"href": "https://cavatica-api.sbgenomics.com/v2/projects/mock/cypress-project",
"id": "mock/cypress-project",
"name": "Cypress-Project",
"category": "PRIVATE",
"created_by": "mock",
"created_on": "2024-07-05T00:00:00Z",
"modified_on": "2024-07-05T00:00:00Z"
}
],
"links": []
},
}).as('cavaticaProjects');

it('Vérifier les informations affichées - Modal', () => {
cy.get('[class="ant-modal-confirm-body"]').contains('Connect to Cavatica').should('exist');
cy.get('[class="ant-modal-confirm-body"]').contains('In order to analyze your files you must first connect your Cavatica account. Once you are connected, you will be redirected back to this page.').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-default"]').contains('Cancel').should('exist');
cy.get('[class="ant-modal-confirm-btns"] button[class*="ant-btn-primary"]').contains('Connect').should('exist');
});
cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz');
cy.wait('@cavaticaAuthenticated');
cy.wait('@cavaticaProjects');
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});

describe('Page Dashboard - Bouton Analyze in Cavatica (connecté)', () => {
beforeEach(() => {
cy.intercept('GET', '**/cavatica/authenticated', {
statusCode: 200,
body: {
"authenticated": true,
"expiration": 1722180513
},
}).as('cavaticaAuthenticated');
cy.intercept('GET', '**/cavatica2/v2/projects', {
statusCode: 200,
body: {
"href": "https://cavatica-api.sbgenomics.com/v2/projects?offset=0&limit=50",
"items": [
{
"href": "https://cavatica-api.sbgenomics.com/v2/projects/mock/cypress-project",
"id": "mock/cypress-project",
"name": "Cypress-Project",
"category": "PRIVATE",
"created_by": "mock",
"created_on": "2024-07-05T00:00:00Z",
"modified_on": "2024-07-05T00:00:00Z"
}
],
"links": []
},
}).as('cavaticaProjects');

cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762');
cy.wait('@cavaticaAuthenticated');
cy.wait('@cavaticaProjects');
cy.get('tr[data-row-key="HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.rsem.isoforms.results.gz"] [type="checkbox"]').check({force: true});
cy.get('button[aria-label="Analyze in Cavatica"]').clickAndWait({force: true});
});

it('Vérifier les informations affichées - Modal', () => {
cy.get('[class="ant-modal-title"]').contains('Analyze in Cavatica').should('exist');
cy.get('[class="ant-modal-body"]').contains('Copy files to...').should('exist');
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/Colonnes/TableauBiospecimens.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitDataExploration('biospecimens');
});

describe('Page Data Exploration (Biospecimens) - Colonnes du tableau', () => {
beforeEach(() => {
cy.visitDataExploration('biospecimens');
});

it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => {
cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(1)
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/Colonnes/TableauFiles.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitDataExploration('datafiles');
});

describe('Page Data Exploration (Files) - Colonnes du tableau', () => {
beforeEach(() => {
cy.visitDataExploration('datafiles');
});

it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => {
cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(1)
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/Colonnes/TableauParticipants.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitDataExploration('participants');
});

describe('Page Data Exploration (Participants) - Colonnes du tableau', () => {
beforeEach(() => {
cy.visitDataExploration('participants');
});

it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => {
cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(1)
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/Colonnes/TableauStudies.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitStudiesPage();
});

describe('Page des études - Colonnes du tableau', () => {
beforeEach(() => {
cy.visitStudiesPage();
});

it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => {
cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(0)
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/Colonnes/TableauVariants.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitVariantsPage();
});

describe('Page des variants - Colonnes du tableau', () => {
beforeEach(() => {
cy.visitVariantsPage();
});

it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => {
cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(1)
Expand Down
7 changes: 2 additions & 5 deletions cypress/e2e/Colonnes/TableauxPageFile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import '../../support/commands';

beforeEach(() => {
cy.login();
cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz');
cy.resetColumns('participant-sample');
});

describe('Page d\'un fichier - Colonnes du tableau Participants-Samples', () => {
beforeEach(() => {
cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz');
cy.resetColumns('participant-sample');
});

it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => {
cy.get('[id="participant-sample"]')
.find('thead[class="ant-table-thead"]')
Expand Down
Loading