From 81ef1affc9ff3370f64c43a48eb6813b37978b6c Mon Sep 17 00:00:00 2001 From: kstonge Date: Fri, 21 Feb 2025 11:39:55 -0500 Subject: [PATCH] feat: SJIP-1214 Refactor Cypress tests - Solve skip tests and split file tests --- .../PageDataExploration_1.cy.ts | 18 + ...File.cy.ts => PageDataExploration_2.cy.ts} | 76 ++- cypress/e2e/CavaticaButton/PageFile_1.cy.ts | 17 + ...DataExploration.cy.ts => PageFile_2.cy.ts} | 77 ++- .../e2e/Colonnes/TableauBiospecimens.cy.ts | 5 +- cypress/e2e/Colonnes/TableauFiles.cy.ts | 5 +- .../e2e/Colonnes/TableauParticipants.cy.ts | 5 +- cypress/e2e/Colonnes/TableauStudies.cy.ts | 5 +- cypress/e2e/Colonnes/TableauVariants.cy.ts | 5 +- cypress/e2e/Colonnes/TableauxPageFile.cy.ts | 7 +- .../Colonnes/TableauxPageParticipant.cy.ts | 276 ----------- .../Colonnes/TableauxPageParticipant_1.cy.ts | 52 ++ .../Colonnes/TableauxPageParticipant_2.cy.ts | 58 +++ .../Colonnes/TableauxPageParticipant_3.cy.ts | 58 +++ .../Colonnes/TableauxPageParticipant_4.cy.ts | 114 +++++ cypress/e2e/Consultation/PageFile_1.cy.ts | 30 ++ .../{PageFile.cy.ts => PageFile_2.cy.ts} | 82 ---- cypress/e2e/Consultation/PageFile_3.cy.ts | 32 ++ cypress/e2e/Consultation/PageFile_4.cy.ts | 41 ++ .../e2e/Consultation/PageParticipant_1.cy.ts | 30 ++ ...ticipant.cy.ts => PageParticipant_2.cy.ts} | 177 ------- .../e2e/Consultation/PageParticipant_3.cy.ts | 103 ++++ .../e2e/Consultation/PageParticipant_4.cy.ts | 65 +++ ...ings.cy.ts => PageProfileSettings_1.cy.ts} | 144 ------ .../Consultation/PageProfileSettings_2.cy.ts | 148 ++++++ cypress/e2e/Consultation/PageStudy_1.cy.ts | 30 ++ .../{PageStudy.cy.ts => PageStudy_2.cy.ts} | 162 ------- cypress/e2e/Consultation/PageStudy_3.cy.ts | 98 ++++ cypress/e2e/Consultation/PageStudy_4.cy.ts | 55 +++ ...{PageVariant.cy.ts => PageVariant_1.cy.ts} | 170 ------- cypress/e2e/Consultation/PageVariant_2.cy.ts | 135 ++++++ cypress/e2e/Consultation/PageVariant_3.cy.ts | 49 ++ .../Consultation/TableauBiospecimens_1.cy.ts | 41 ++ .../Consultation/TableauBiospecimens_2.cy.ts | 34 ++ ...mens.cy.ts => TableauBiospecimens_3.cy.ts} | 85 +--- cypress/e2e/Consultation/TableauFiles_1.cy.ts | 34 ++ cypress/e2e/Consultation/TableauFiles_2.cy.ts | 34 ++ ...ableauFiles.cy.ts => TableauFiles_3.cy.ts} | 74 +-- .../Consultation/TableauParticipants.cy.ts | 254 ---------- .../Consultation/TableauParticipants_1.cy.ts | 48 ++ .../Consultation/TableauParticipants_2.cy.ts | 78 +++ .../Consultation/TableauParticipants_3.cy.ts | 125 +++++ cypress/e2e/Consultation/TableauStudies.cy.ts | 154 ------ .../e2e/Consultation/TableauStudies_1.cy.ts | 47 ++ .../e2e/Consultation/TableauStudies_2.cy.ts | 58 +++ .../e2e/Consultation/TableauStudies_3.cy.ts | 73 +++ ...Variants.cy.ts => TableauVariants_1.cy.ts} | 114 +---- .../e2e/Consultation/TableauVariants_2.cy.ts | 103 ++++ .../e2e/Facettes/PageDataExploration.cy.ts | 319 ------------- .../e2e/Facettes/PageDataExploration_1.cy.ts | 125 +++++ .../e2e/Facettes/PageDataExploration_2.cy.ts | 124 +++++ .../e2e/Facettes/PageDataExploration_3.cy.ts | 73 +++ cypress/e2e/Facettes/PageStudies.cy.ts | 5 +- cypress/e2e/Facettes/PageVariants.cy.ts | 444 ------------------ cypress/e2e/Facettes/PageVariants_1.cy.ts | 27 ++ cypress/e2e/Facettes/PageVariants_2.cy.ts | 174 +++++++ cypress/e2e/Facettes/PageVariants_3.cy.ts | 123 +++++ cypress/e2e/Facettes/PageVariants_4.cy.ts | 77 +++ cypress/e2e/Facettes/PageVariants_5.cy.ts | 52 ++ .../e2e/Filtres/PageDataExploration_1.cy.ts | 24 + ...tion.cy.ts => PageDataExploration_2.cy.ts} | 72 +-- .../e2e/Filtres/PageDataExploration_3.cy.ts | 41 ++ cypress/e2e/Filtres/PageVariants_1.cy.ts | 24 + ...ageVariants.cy.ts => PageVariants_2.cy.ts} | 72 +-- cypress/e2e/Filtres/PageVariants_3.cy.ts | 41 ++ .../{Dataset.cy.ts => Dataset_1.cy.ts} | 38 +- cypress/e2e/ManifestButton/Dataset_2.cy.ts | 29 ++ cypress/e2e/ManifestButton/Dataset_3.cy.ts | 34 ++ ...tion.cy.ts => PageDataExploration_1.cy.ts} | 46 +- .../PageDataExploration_2.cy.ts | 30 ++ .../PageDataExploration_3.cy.ts | 31 ++ .../{PageFile.cy.ts => PageFile_1.cy.ts} | 46 +- cypress/e2e/ManifestButton/PageFile_2.cy.ts | 29 ++ cypress/e2e/ManifestButton/PageFile_3.cy.ts | 30 ++ .../{PageStudy.cy.ts => PageStudy_1.cy.ts} | 25 +- cypress/e2e/ManifestButton/PageStudy_2.cy.ts | 29 ++ cypress/e2e/Recherche/PageStudies.cy.ts | 1 - cypress/e2e/Requetes/ActionsSur0Requete.cy.ts | 14 +- .../Requetes/ActionsSur1Requete1Pilule.cy.ts | 14 +- .../Requetes/ActionsSur1Requete2Pilules.cy.ts | 14 +- .../e2e/Requetes/ActionsSur2Requetes.cy.ts | 14 +- .../e2e/Requetes/ActionsSurCombinaison.cy.ts | 14 +- .../e2e/Requetes/ValidationParticipants.cy.ts | 21 +- .../SaveSetButton/PageDataExploration.cy.ts | 248 ---------- .../SaveSetButton/PageDataExploration_1.cy.ts | 83 ++++ .../SaveSetButton/PageDataExploration_2.cy.ts | 83 ++++ .../SaveSetButton/PageDataExploration_3.cy.ts | 83 ++++ .../ClinicalDataPageParticipant_1.cy.ts | 25 + ...ts => ClinicalDataPageParticipant_2.cy.ts} | 22 +- .../ClinicalDataPageStudy_1.cy.ts | 25 + ...dy.cy.ts => ClinicalDataPageStudy_2.cy.ts} | 22 +- .../ClinicalDataTableauParticipants_1.cy.ts | 26 + ...> ClinicalDataTableauParticipants_2.cy.ts} | 22 +- .../e2e/Telechargement/TableauxPageFile.cy.ts | 13 +- .../TableauxPageParticipant.cy.ts | 93 ---- .../TableauxPageParticipant_1.cy.ts | 27 ++ .../TableauxPageParticipant_2.cy.ts | 27 ++ .../TableauxPageParticipant_3.cy.ts | 27 ++ .../TableauxPageParticipant_4.cy.ts | 27 ++ .../e2e/UploadList/PageDataExploration.cy.ts | 276 ----------- .../UploadList/PageDataExploration_1.cy.ts | 92 ++++ .../UploadList/PageDataExploration_2.cy.ts | 92 ++++ .../UploadList/PageDataExploration_3.cy.ts | 89 ++++ cypress/e2e/Widgets/AuthorizedStudies_1.cy.ts | 38 ++ ...tudies.cy.ts => AuthorizedStudies_2.cy.ts} | 100 ++-- cypress/e2e/Widgets/BiospecimenRequests.cy.ts | 128 ----- .../e2e/Widgets/BiospecimenRequests_1.cy.ts | 30 ++ .../e2e/Widgets/BiospecimenRequests_2.cy.ts | 51 ++ .../e2e/Widgets/BiospecimenRequests_3.cy.ts | 35 ++ cypress/e2e/Widgets/CavaticaProjects_1.cy.ts | 38 ++ ...rojects.cy.ts => CavaticaProjects_2.cy.ts} | 94 ++-- cypress/e2e/Widgets/SavedFilters.cy.ts | 101 ---- cypress/e2e/Widgets/SavedFilters_1.cy.ts | 39 ++ cypress/e2e/Widgets/SavedFilters_2.cy.ts | 39 ++ cypress/e2e/Widgets/SavedFilters_3.cy.ts | 26 + cypress/e2e/Widgets/SavedSets.cy.ts | 115 ----- cypress/e2e/Widgets/SavedSets_1.cy.ts | 39 ++ cypress/e2e/Widgets/SavedSets_2.cy.ts | 53 +++ cypress/e2e/Widgets/SavedSets_3.cy.ts | 26 + 119 files changed, 4233 insertions(+), 4082 deletions(-) create mode 100644 cypress/e2e/CavaticaButton/PageDataExploration_1.cy.ts rename cypress/e2e/CavaticaButton/{PageFile.cy.ts => PageDataExploration_2.cy.ts} (60%) create mode 100644 cypress/e2e/CavaticaButton/PageFile_1.cy.ts rename cypress/e2e/CavaticaButton/{PageDataExploration.cy.ts => PageFile_2.cy.ts} (57%) delete mode 100644 cypress/e2e/Colonnes/TableauxPageParticipant.cy.ts create mode 100644 cypress/e2e/Colonnes/TableauxPageParticipant_1.cy.ts create mode 100644 cypress/e2e/Colonnes/TableauxPageParticipant_2.cy.ts create mode 100644 cypress/e2e/Colonnes/TableauxPageParticipant_3.cy.ts create mode 100644 cypress/e2e/Colonnes/TableauxPageParticipant_4.cy.ts create mode 100644 cypress/e2e/Consultation/PageFile_1.cy.ts rename cypress/e2e/Consultation/{PageFile.cy.ts => PageFile_2.cy.ts} (54%) create mode 100644 cypress/e2e/Consultation/PageFile_3.cy.ts create mode 100644 cypress/e2e/Consultation/PageFile_4.cy.ts create mode 100644 cypress/e2e/Consultation/PageParticipant_1.cy.ts rename cypress/e2e/Consultation/{PageParticipant.cy.ts => PageParticipant_2.cy.ts} (60%) create mode 100644 cypress/e2e/Consultation/PageParticipant_3.cy.ts create mode 100644 cypress/e2e/Consultation/PageParticipant_4.cy.ts rename cypress/e2e/Consultation/{PageProfileSettings.cy.ts => PageProfileSettings_1.cy.ts} (52%) create mode 100644 cypress/e2e/Consultation/PageProfileSettings_2.cy.ts create mode 100644 cypress/e2e/Consultation/PageStudy_1.cy.ts rename cypress/e2e/Consultation/{PageStudy.cy.ts => PageStudy_2.cy.ts} (73%) create mode 100644 cypress/e2e/Consultation/PageStudy_3.cy.ts create mode 100644 cypress/e2e/Consultation/PageStudy_4.cy.ts rename cypress/e2e/Consultation/{PageVariant.cy.ts => PageVariant_1.cy.ts} (63%) create mode 100644 cypress/e2e/Consultation/PageVariant_2.cy.ts create mode 100644 cypress/e2e/Consultation/PageVariant_3.cy.ts create mode 100644 cypress/e2e/Consultation/TableauBiospecimens_1.cy.ts create mode 100644 cypress/e2e/Consultation/TableauBiospecimens_2.cy.ts rename cypress/e2e/Consultation/{TableauBiospecimens.cy.ts => TableauBiospecimens_3.cy.ts} (55%) create mode 100644 cypress/e2e/Consultation/TableauFiles_1.cy.ts create mode 100644 cypress/e2e/Consultation/TableauFiles_2.cy.ts rename cypress/e2e/Consultation/{TableauFiles.cy.ts => TableauFiles_3.cy.ts} (54%) delete mode 100644 cypress/e2e/Consultation/TableauParticipants.cy.ts create mode 100644 cypress/e2e/Consultation/TableauParticipants_1.cy.ts create mode 100644 cypress/e2e/Consultation/TableauParticipants_2.cy.ts create mode 100644 cypress/e2e/Consultation/TableauParticipants_3.cy.ts delete mode 100644 cypress/e2e/Consultation/TableauStudies.cy.ts create mode 100644 cypress/e2e/Consultation/TableauStudies_1.cy.ts create mode 100644 cypress/e2e/Consultation/TableauStudies_2.cy.ts create mode 100644 cypress/e2e/Consultation/TableauStudies_3.cy.ts rename cypress/e2e/Consultation/{TableauVariants.cy.ts => TableauVariants_1.cy.ts} (53%) create mode 100644 cypress/e2e/Consultation/TableauVariants_2.cy.ts delete mode 100644 cypress/e2e/Facettes/PageDataExploration.cy.ts create mode 100644 cypress/e2e/Facettes/PageDataExploration_1.cy.ts create mode 100644 cypress/e2e/Facettes/PageDataExploration_2.cy.ts create mode 100644 cypress/e2e/Facettes/PageDataExploration_3.cy.ts delete mode 100644 cypress/e2e/Facettes/PageVariants.cy.ts create mode 100644 cypress/e2e/Facettes/PageVariants_1.cy.ts create mode 100644 cypress/e2e/Facettes/PageVariants_2.cy.ts create mode 100644 cypress/e2e/Facettes/PageVariants_3.cy.ts create mode 100644 cypress/e2e/Facettes/PageVariants_4.cy.ts create mode 100644 cypress/e2e/Facettes/PageVariants_5.cy.ts create mode 100644 cypress/e2e/Filtres/PageDataExploration_1.cy.ts rename cypress/e2e/Filtres/{PageDataExploration.cy.ts => PageDataExploration_2.cy.ts} (60%) create mode 100644 cypress/e2e/Filtres/PageDataExploration_3.cy.ts create mode 100644 cypress/e2e/Filtres/PageVariants_1.cy.ts rename cypress/e2e/Filtres/{PageVariants.cy.ts => PageVariants_2.cy.ts} (60%) create mode 100644 cypress/e2e/Filtres/PageVariants_3.cy.ts rename cypress/e2e/ManifestButton/{Dataset.cy.ts => Dataset_1.cy.ts} (75%) create mode 100644 cypress/e2e/ManifestButton/Dataset_2.cy.ts create mode 100644 cypress/e2e/ManifestButton/Dataset_3.cy.ts rename cypress/e2e/ManifestButton/{PageDataExploration.cy.ts => PageDataExploration_1.cy.ts} (66%) create mode 100644 cypress/e2e/ManifestButton/PageDataExploration_2.cy.ts create mode 100644 cypress/e2e/ManifestButton/PageDataExploration_3.cy.ts rename cypress/e2e/ManifestButton/{PageFile.cy.ts => PageFile_1.cy.ts} (66%) create mode 100644 cypress/e2e/ManifestButton/PageFile_2.cy.ts create mode 100644 cypress/e2e/ManifestButton/PageFile_3.cy.ts rename cypress/e2e/ManifestButton/{PageStudy.cy.ts => PageStudy_1.cy.ts} (82%) create mode 100644 cypress/e2e/ManifestButton/PageStudy_2.cy.ts delete mode 100644 cypress/e2e/SaveSetButton/PageDataExploration.cy.ts create mode 100644 cypress/e2e/SaveSetButton/PageDataExploration_1.cy.ts create mode 100644 cypress/e2e/SaveSetButton/PageDataExploration_2.cy.ts create mode 100644 cypress/e2e/SaveSetButton/PageDataExploration_3.cy.ts create mode 100644 cypress/e2e/Telechargement/ClinicalDataPageParticipant_1.cy.ts rename cypress/e2e/Telechargement/{ClinicalDataPageParticipant.cy.ts => ClinicalDataPageParticipant_2.cy.ts} (53%) create mode 100644 cypress/e2e/Telechargement/ClinicalDataPageStudy_1.cy.ts rename cypress/e2e/Telechargement/{ClinicalDataPageStudy.cy.ts => ClinicalDataPageStudy_2.cy.ts} (53%) create mode 100644 cypress/e2e/Telechargement/ClinicalDataTableauParticipants_1.cy.ts rename cypress/e2e/Telechargement/{ClinicalDataTableauParticipants.cy.ts => ClinicalDataTableauParticipants_2.cy.ts} (58%) delete mode 100644 cypress/e2e/Telechargement/TableauxPageParticipant.cy.ts create mode 100644 cypress/e2e/Telechargement/TableauxPageParticipant_1.cy.ts create mode 100644 cypress/e2e/Telechargement/TableauxPageParticipant_2.cy.ts create mode 100644 cypress/e2e/Telechargement/TableauxPageParticipant_3.cy.ts create mode 100644 cypress/e2e/Telechargement/TableauxPageParticipant_4.cy.ts delete mode 100644 cypress/e2e/UploadList/PageDataExploration.cy.ts create mode 100644 cypress/e2e/UploadList/PageDataExploration_1.cy.ts create mode 100644 cypress/e2e/UploadList/PageDataExploration_2.cy.ts create mode 100644 cypress/e2e/UploadList/PageDataExploration_3.cy.ts create mode 100644 cypress/e2e/Widgets/AuthorizedStudies_1.cy.ts rename cypress/e2e/Widgets/{AuthorizedStudies.cy.ts => AuthorizedStudies_2.cy.ts} (51%) delete mode 100644 cypress/e2e/Widgets/BiospecimenRequests.cy.ts create mode 100644 cypress/e2e/Widgets/BiospecimenRequests_1.cy.ts create mode 100644 cypress/e2e/Widgets/BiospecimenRequests_2.cy.ts create mode 100644 cypress/e2e/Widgets/BiospecimenRequests_3.cy.ts create mode 100644 cypress/e2e/Widgets/CavaticaProjects_1.cy.ts rename cypress/e2e/Widgets/{CavaticaProjects.cy.ts => CavaticaProjects_2.cy.ts} (55%) delete mode 100644 cypress/e2e/Widgets/SavedFilters.cy.ts create mode 100644 cypress/e2e/Widgets/SavedFilters_1.cy.ts create mode 100644 cypress/e2e/Widgets/SavedFilters_2.cy.ts create mode 100644 cypress/e2e/Widgets/SavedFilters_3.cy.ts delete mode 100644 cypress/e2e/Widgets/SavedSets.cy.ts create mode 100644 cypress/e2e/Widgets/SavedSets_1.cy.ts create mode 100644 cypress/e2e/Widgets/SavedSets_2.cy.ts create mode 100644 cypress/e2e/Widgets/SavedSets_3.cy.ts diff --git a/cypress/e2e/CavaticaButton/PageDataExploration_1.cy.ts b/cypress/e2e/CavaticaButton/PageDataExploration_1.cy.ts new file mode 100644 index 00000000..1f70d571 --- /dev/null +++ b/cypress/e2e/CavaticaButton/PageDataExploration_1.cy.ts @@ -0,0 +1,18 @@ +/// +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'); + }); +}); diff --git a/cypress/e2e/CavaticaButton/PageFile.cy.ts b/cypress/e2e/CavaticaButton/PageDataExploration_2.cy.ts similarity index 60% rename from cypress/e2e/CavaticaButton/PageFile.cy.ts rename to cypress/e2e/CavaticaButton/PageDataExploration_2.cy.ts index a62e2c5b..7de5355e 100644 --- a/cypress/e2e/CavaticaButton/PageFile.cy.ts +++ b/cypress/e2e/CavaticaButton/PageDataExploration_2.cy.ts @@ -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'); diff --git a/cypress/e2e/CavaticaButton/PageFile_1.cy.ts b/cypress/e2e/CavaticaButton/PageFile_1.cy.ts new file mode 100644 index 00000000..4e6588c1 --- /dev/null +++ b/cypress/e2e/CavaticaButton/PageFile_1.cy.ts @@ -0,0 +1,17 @@ +/// +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'); + }); +}); diff --git a/cypress/e2e/CavaticaButton/PageDataExploration.cy.ts b/cypress/e2e/CavaticaButton/PageFile_2.cy.ts similarity index 57% rename from cypress/e2e/CavaticaButton/PageDataExploration.cy.ts rename to cypress/e2e/CavaticaButton/PageFile_2.cy.ts index 77c43447..15e3834d 100644 --- a/cypress/e2e/CavaticaButton/PageDataExploration.cy.ts +++ b/cypress/e2e/CavaticaButton/PageFile_2.cy.ts @@ -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'); diff --git a/cypress/e2e/Colonnes/TableauBiospecimens.cy.ts b/cypress/e2e/Colonnes/TableauBiospecimens.cy.ts index 168bbf08..d7249442 100644 --- a/cypress/e2e/Colonnes/TableauBiospecimens.cy.ts +++ b/cypress/e2e/Colonnes/TableauBiospecimens.cy.ts @@ -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) diff --git a/cypress/e2e/Colonnes/TableauFiles.cy.ts b/cypress/e2e/Colonnes/TableauFiles.cy.ts index 63bafd16..a281628f 100644 --- a/cypress/e2e/Colonnes/TableauFiles.cy.ts +++ b/cypress/e2e/Colonnes/TableauFiles.cy.ts @@ -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) diff --git a/cypress/e2e/Colonnes/TableauParticipants.cy.ts b/cypress/e2e/Colonnes/TableauParticipants.cy.ts index bf6c7f76..58c91468 100644 --- a/cypress/e2e/Colonnes/TableauParticipants.cy.ts +++ b/cypress/e2e/Colonnes/TableauParticipants.cy.ts @@ -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) diff --git a/cypress/e2e/Colonnes/TableauStudies.cy.ts b/cypress/e2e/Colonnes/TableauStudies.cy.ts index e0155779..1d44d492 100644 --- a/cypress/e2e/Colonnes/TableauStudies.cy.ts +++ b/cypress/e2e/Colonnes/TableauStudies.cy.ts @@ -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) diff --git a/cypress/e2e/Colonnes/TableauVariants.cy.ts b/cypress/e2e/Colonnes/TableauVariants.cy.ts index aa3e5c5b..311cf8e8 100644 --- a/cypress/e2e/Colonnes/TableauVariants.cy.ts +++ b/cypress/e2e/Colonnes/TableauVariants.cy.ts @@ -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) diff --git a/cypress/e2e/Colonnes/TableauxPageFile.cy.ts b/cypress/e2e/Colonnes/TableauxPageFile.cy.ts index e8344d47..99681aaa 100644 --- a/cypress/e2e/Colonnes/TableauxPageFile.cy.ts +++ b/cypress/e2e/Colonnes/TableauxPageFile.cy.ts @@ -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"]') diff --git a/cypress/e2e/Colonnes/TableauxPageParticipant.cy.ts b/cypress/e2e/Colonnes/TableauxPageParticipant.cy.ts deleted file mode 100644 index 82735fb1..00000000 --- a/cypress/e2e/Colonnes/TableauxPageParticipant.cy.ts +++ /dev/null @@ -1,276 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page d\'un participant - Colonnes du tableau Family', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('family'); - }); - - it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { - cy.get('[id="family"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(0) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Participant ID').should('exist'); - - cy.get('[id="family"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(1) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Family Relationship').should('exist'); - - cy.get('[id="family"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(2) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Down Syndrome Status').should('exist'); - }); - - it('Masquer/Afficher une colonne affichée', () => { - cy.get('[id="family"]') - .find('thead[class="ant-table-thead"]') - .contains('Participant ID').should('exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Participant ID') - .find('[type="checkbox"]').uncheck({force: true}); - - cy.get('[id="family"]') - .find('thead[class="ant-table-thead"]') - .contains('Participant ID').should('not.exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Participant ID') - .find('[type="checkbox"]').check({force: true}); - - cy.get('[id="family"]') - .find('thead[class="ant-table-thead"]') - .contains('Participant ID').should('exist'); - }); -}); - -describe('Page d\'un participant - Colonnes du tableau Diagnoses', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('diagnosis'); - }); - - it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(0) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Diagnosis (MONDO)').should('exist'); - - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(1) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Condition (Source Text)').should('exist'); - - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(2) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Age').should('exist'); - - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(3) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('MONDO Term').should('exist'); - }); - - it('Masquer/Afficher une colonne affichée', () => { - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .contains('Diagnosis (MONDO)').should('exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Diagnosis (MONDO)') - .find('[type="checkbox"]').uncheck({force: true}); - - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .contains('Diagnosis (MONDO)').should('not.exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Diagnosis (MONDO)') - .find('[type="checkbox"]').check({force: true}); - - cy.get('[id="diagnosis"]') - .find('thead[class="ant-table-thead"]') - .contains('Diagnosis (MONDO)').should('exist'); - }); -}); - -describe('Page d\'un participant - Colonnes du tableau Phenotypes', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('phenotype'); - }); - - it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(0) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Phenotype (HPO)').should('exist'); - - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(1) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Condition (Source Text)').should('exist'); - - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(2) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Age').should('exist'); - - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(3) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('HPO Term').should('exist'); - }); - - it('Masquer/Afficher une colonne affichée', () => { - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .contains('Phenotype (HPO)').should('exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Phenotype (HPO)') - .find('[type="checkbox"]').uncheck({force: true}); - - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .contains('Phenotype (HPO)').should('not.exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Phenotype (HPO)') - .find('[type="checkbox"]').check({force: true}); - - cy.get('[id="phenotype"]') - .find('thead[class="ant-table-thead"]') - .contains('Phenotype (HPO)').should('exist'); - }); -}); - -describe('Page d\'un participant - Colonnes du tableau Biospecimens', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('biospecimen'); - }); - - it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { - cy.get('[id="biospecimen"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(0) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Sample ID').should('exist'); - - cy.get('[id="biospecimen"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(1) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Collection ID').should('exist'); - - cy.get('[id="biospecimen"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(2) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Container ID').should('exist'); - - cy.get('[id="biospecimen"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(3) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Sample Type').should('exist'); - - cy.get('[id="biospecimen"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(4) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Collection Sample Type').should('exist'); - - cy.get('[id="biospecimen"]') - .find('thead[class="ant-table-thead"]') - .find('th[class*="ant-table-cell"]').eq(5) - .should('not.have.class', 'ant-table-column-has-sorters') - .contains('Age').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Volume').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(7) - .contains('Volume').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Volume Unit').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(8) - .contains('Volume Unit').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Sample Availability').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(9) - .contains('Sample Availability').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Laboratory Procedure').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(10) - .contains('Laboratory Procedure').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Biospecimen Storage').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(11) - .contains('Biospecimen Storage').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Parent Sample ID').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(12) - .contains('Parent Sample ID').should('exist'); - - cy.get('thead[class="ant-table-thead"]') - .contains('Parent Sample Type').should('not.exist'); - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').eq(13) - .contains('Parent Sample Type').should('exist'); - }); - - it('Masquer une colonne affichée', () => { - cy.get('thead[class="ant-table-thead"]') - .contains('Collection ID').should('exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Collection ID') - .find('[type="checkbox"]').uncheck({force: true}); - - cy.get('thead[class="ant-table-thead"]') - .contains('Collection ID').should('not.exist'); - }); - - it('Afficher une colonne masquée', () => { - cy.get('thead[class="ant-table-thead"]') - .contains('Volume Unit').should('not.exist'); - - cy.get('div[class="ant-popover-inner"]') - .find('div[class="ant-space-item"]').contains('Volume Unit') - .find('[type="checkbox"]').check({force: true}); - - cy.get('thead[class="ant-table-thead"]') - .contains('Volume Unit').should('exist'); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/Colonnes/TableauxPageParticipant_1.cy.ts b/cypress/e2e/Colonnes/TableauxPageParticipant_1.cy.ts new file mode 100644 index 00000000..e5a186c3 --- /dev/null +++ b/cypress/e2e/Colonnes/TableauxPageParticipant_1.cy.ts @@ -0,0 +1,52 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('family'); +}); + +describe('Page d\'un participant - Colonnes du tableau Family', () => { + it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { + cy.get('[id="family"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(0) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Participant ID').should('exist'); + + cy.get('[id="family"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(1) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Family Relationship').should('exist'); + + cy.get('[id="family"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(2) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Down Syndrome Status').should('exist'); + }); + + it('Masquer/Afficher une colonne affichée', () => { + cy.get('[id="family"]') + .find('thead[class="ant-table-thead"]') + .contains('Participant ID').should('exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Participant ID') + .find('[type="checkbox"]').uncheck({force: true}); + + cy.get('[id="family"]') + .find('thead[class="ant-table-thead"]') + .contains('Participant ID').should('not.exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Participant ID') + .find('[type="checkbox"]').check({force: true}); + + cy.get('[id="family"]') + .find('thead[class="ant-table-thead"]') + .contains('Participant ID').should('exist'); + }); +}); diff --git a/cypress/e2e/Colonnes/TableauxPageParticipant_2.cy.ts b/cypress/e2e/Colonnes/TableauxPageParticipant_2.cy.ts new file mode 100644 index 00000000..09b76862 --- /dev/null +++ b/cypress/e2e/Colonnes/TableauxPageParticipant_2.cy.ts @@ -0,0 +1,58 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('diagnosis'); +}); + +describe('Page d\'un participant - Colonnes du tableau Diagnoses', () => { + it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(0) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Diagnosis (MONDO)').should('exist'); + + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(1) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Condition (Source Text)').should('exist'); + + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(2) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Age').should('exist'); + + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(3) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('MONDO Term').should('exist'); + }); + + it('Masquer/Afficher une colonne affichée', () => { + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .contains('Diagnosis (MONDO)').should('exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Diagnosis (MONDO)') + .find('[type="checkbox"]').uncheck({force: true}); + + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .contains('Diagnosis (MONDO)').should('not.exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Diagnosis (MONDO)') + .find('[type="checkbox"]').check({force: true}); + + cy.get('[id="diagnosis"]') + .find('thead[class="ant-table-thead"]') + .contains('Diagnosis (MONDO)').should('exist'); + }); +}); diff --git a/cypress/e2e/Colonnes/TableauxPageParticipant_3.cy.ts b/cypress/e2e/Colonnes/TableauxPageParticipant_3.cy.ts new file mode 100644 index 00000000..507c91aa --- /dev/null +++ b/cypress/e2e/Colonnes/TableauxPageParticipant_3.cy.ts @@ -0,0 +1,58 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('phenotype'); +}); + +describe('Page d\'un participant - Colonnes du tableau Phenotypes', () => { + it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(0) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Phenotype (HPO)').should('exist'); + + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(1) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Condition (Source Text)').should('exist'); + + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(2) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Age').should('exist'); + + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(3) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('HPO Term').should('exist'); + }); + + it('Masquer/Afficher une colonne affichée', () => { + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .contains('Phenotype (HPO)').should('exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Phenotype (HPO)') + .find('[type="checkbox"]').uncheck({force: true}); + + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .contains('Phenotype (HPO)').should('not.exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Phenotype (HPO)') + .find('[type="checkbox"]').check({force: true}); + + cy.get('[id="phenotype"]') + .find('thead[class="ant-table-thead"]') + .contains('Phenotype (HPO)').should('exist'); + }); +}); diff --git a/cypress/e2e/Colonnes/TableauxPageParticipant_4.cy.ts b/cypress/e2e/Colonnes/TableauxPageParticipant_4.cy.ts new file mode 100644 index 00000000..f49c29a2 --- /dev/null +++ b/cypress/e2e/Colonnes/TableauxPageParticipant_4.cy.ts @@ -0,0 +1,114 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('biospecimen'); +}); + +describe('Page d\'un participant - Colonnes du tableau Biospecimens', () => { + it('Valider l\'affichage (par défaut/optionnel) et l\'ordre des colonnes', () => { + cy.get('[id="biospecimen"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(0) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Sample ID').should('exist'); + + cy.get('[id="biospecimen"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(1) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Collection ID').should('exist'); + + cy.get('[id="biospecimen"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(2) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Container ID').should('exist'); + + cy.get('[id="biospecimen"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(3) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Sample Type').should('exist'); + + cy.get('[id="biospecimen"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(4) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Collection Sample Type').should('exist'); + + cy.get('[id="biospecimen"]') + .find('thead[class="ant-table-thead"]') + .find('th[class*="ant-table-cell"]').eq(5) + .should('not.have.class', 'ant-table-column-has-sorters') + .contains('Age').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Volume').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(7) + .contains('Volume').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Volume Unit').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(8) + .contains('Volume Unit').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Sample Availability').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(9) + .contains('Sample Availability').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Laboratory Procedure').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(10) + .contains('Laboratory Procedure').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Biospecimen Storage').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(11) + .contains('Biospecimen Storage').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Parent Sample ID').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(12) + .contains('Parent Sample ID').should('exist'); + + cy.get('thead[class="ant-table-thead"]') + .contains('Parent Sample Type').should('not.exist'); + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').eq(13) + .contains('Parent Sample Type').should('exist'); + }); + + it('Masquer une colonne affichée', () => { + cy.get('thead[class="ant-table-thead"]') + .contains('Collection ID').should('exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Collection ID') + .find('[type="checkbox"]').uncheck({force: true}); + + cy.get('thead[class="ant-table-thead"]') + .contains('Collection ID').should('not.exist'); + }); + + it('Afficher une colonne masquée', () => { + cy.get('thead[class="ant-table-thead"]') + .contains('Volume Unit').should('not.exist'); + + cy.get('div[class="ant-popover-inner"]') + .find('div[class="ant-space-item"]').contains('Volume Unit') + .find('[type="checkbox"]').check({force: true}); + + cy.get('thead[class="ant-table-thead"]') + .contains('Volume Unit').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageFile_1.cy.ts b/cypress/e2e/Consultation/PageFile_1.cy.ts new file mode 100644 index 00000000..3e19c14a --- /dev/null +++ b/cypress/e2e/Consultation/PageFile_1.cy.ts @@ -0,0 +1,30 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); +}); + +describe('Page d\'un fichier - Valider les redirections', () => { + it('Studies', () => { + cy.get('a[class*="SummaryHeader_link"]').eq(0).clickAndWait({force: true}); // data-cy="SummaryHeader_Studies_Button" + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Participant', () => { + cy.get('a[class*="SummaryHeader_link"]').eq(1).clickAndWait({force: true}); // data-cy="SummaryHeader_Participants_Button" + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz').should('exist'); + }); + + it('Sample', () => { + cy.get('a[class*="SummaryHeader_link"]').eq(2).clickAndWait({force: true}); // data-cy="SummaryHeader_Samples_Button" + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageFile.cy.ts b/cypress/e2e/Consultation/PageFile_2.cy.ts similarity index 54% rename from cypress/e2e/Consultation/PageFile.cy.ts rename to cypress/e2e/Consultation/PageFile_2.cy.ts index afed3d37..e45dd5a9 100644 --- a/cypress/e2e/Consultation/PageFile.cy.ts +++ b/cypress/e2e/Consultation/PageFile_2.cy.ts @@ -6,29 +6,6 @@ beforeEach(() => { cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); }); -describe('Page d\'un fichier - Valider les redirections', () => { - it('Studies', () => { - cy.get('a[class*="SummaryHeader_link"]').eq(0).clickAndWait({force: true}); // data-cy="SummaryHeader_Studies_Button" - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Participant', () => { - cy.get('a[class*="SummaryHeader_link"]').eq(1).clickAndWait({force: true}); // data-cy="SummaryHeader_Participants_Button" - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz').should('exist'); - }); - - it('Sample', () => { - cy.get('a[class*="SummaryHeader_link"]').eq(2).clickAndWait({force: true}); // data-cy="SummaryHeader_Samples_Button" - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz').should('exist'); - }); -}); - describe('Page d\'un fichier - Vérifier les informations affichées', () => { it('Titre', () => { cy.get('[class*="EntityTitle"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); @@ -96,62 +73,3 @@ describe('Page d\'un fichier - Vérifier les informations affichées', () => { cy.get('[data-row-key="pt-0dxdyebh"] td[class="ant-table-cell"]').eq(6).contains('Peripheral Whole Blood').should('exist'); }); }); - -describe('Page d\'un fichier - Valider les liens disponibles', () => { - it('Lien dbGap du panneau Data Access', () => { - cy.get('[id="data-access"] [class="ant-descriptions-item-content"]').eq(1).invoke('text').then((invokeText) => { - if (!invokeText.includes('-')) { - cy.get('[id="data-access"] [class="ant-descriptions-item-content"]').eq(1).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); - }; - }); - }); - - it('Lien DataExploration du panneau Participants-Samples', () => { - cy.get('[id="participant-sample"] [class="ant-collapse-header"] button').clickAndWait({force: true}); // data-cy="Participants_RedirectLink" - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz').should('exist'); - }); - - it('Lien Participant ID du panneau Participants-Samples', () => { - cy.resetColumns('participant-sample'); - cy.get('[data-row-key="pt-0dxdyebh"] td[class="ant-table-cell"]').eq(0).find('[href]').clickAndWait({force: true}); - cy.get('[id="participant-entity-page"]').should('exist'); - cy.get('[class*="EntityTitle"]').contains('pt-0dxdyebh'); - }); -}); - -describe('Page d\'un fichier - Valider les panneaux masquables', () => { - it('Panneau Summary', () => { - cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="summary"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Data Access', () => { - cy.get('[id="data-access"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="data-access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data-access"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="data-access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data-access"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Data Type', () => { - cy.get('[id="data-type"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="data-type"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data-type"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="data-type"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data-type"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Participants-Samples', () => { - cy.get('[id="participant-sample"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="participant-sample"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="participant-sample"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="participant-sample"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="participant-sample"] div[class*="ant-collapse-content-active"]').should('exist'); - }); -}); diff --git a/cypress/e2e/Consultation/PageFile_3.cy.ts b/cypress/e2e/Consultation/PageFile_3.cy.ts new file mode 100644 index 00000000..2e968abf --- /dev/null +++ b/cypress/e2e/Consultation/PageFile_3.cy.ts @@ -0,0 +1,32 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); +}); + +describe('Page d\'un fichier - Valider les liens disponibles', () => { + it('Lien dbGap du panneau Data Access', () => { + cy.get('[id="data-access"] [class="ant-descriptions-item-content"]').eq(1).invoke('text').then((invokeText) => { + if (!invokeText.includes('-')) { + cy.get('[id="data-access"] [class="ant-descriptions-item-content"]').eq(1).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); + }; + }); + }); + + it('Lien DataExploration du panneau Participants-Samples', () => { + cy.get('[id="participant-sample"] [class="ant-collapse-header"] button').clickAndWait({force: true}); // data-cy="Participants_RedirectLink" + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz').should('exist'); + }); + + it('Lien Participant ID du panneau Participants-Samples', () => { + cy.resetColumns('participant-sample'); + cy.get('[data-row-key="pt-0dxdyebh"] td[class="ant-table-cell"]').eq(0).find('[href]').clickAndWait({force: true}); + cy.get('[id="participant-entity-page"]').should('exist'); + cy.get('[class*="EntityTitle"]').contains('pt-0dxdyebh'); + }); +}); diff --git a/cypress/e2e/Consultation/PageFile_4.cy.ts b/cypress/e2e/Consultation/PageFile_4.cy.ts new file mode 100644 index 00000000..d6364371 --- /dev/null +++ b/cypress/e2e/Consultation/PageFile_4.cy.ts @@ -0,0 +1,41 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); +}); + +describe('Page d\'un fichier - Valider les panneaux masquables', () => { + it('Panneau Summary', () => { + cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="summary"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Data Access', () => { + cy.get('[id="data-access"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="data-access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data-access"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="data-access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data-access"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Data Type', () => { + cy.get('[id="data-type"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="data-type"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data-type"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="data-type"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data-type"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Participants-Samples', () => { + cy.get('[id="participant-sample"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="participant-sample"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="participant-sample"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="participant-sample"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="participant-sample"] div[class*="ant-collapse-content-active"]').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageParticipant_1.cy.ts b/cypress/e2e/Consultation/PageParticipant_1.cy.ts new file mode 100644 index 00000000..383220e1 --- /dev/null +++ b/cypress/e2e/Consultation/PageParticipant_1.cy.ts @@ -0,0 +1,30 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); +}); + +describe('Page d\'un participant - Valider les redirections', () => { + it('Studies', () => { + cy.get('a[class*="SummaryHeader_link"]').eq(0).clickAndWait({force: true}); // data-cy="SummaryHeader_Studies_Button" + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Biospecimens', () => { + cy.get('a[class*="SummaryHeader_link"]').eq(1).clickAndWait({force: true}); // data-cy="SummaryHeader_Biospecimens_Button" + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); + }); + + it('Files', () => { + cy.get('a[class*="SummaryHeader_link"]').eq(2).clickAndWait({force: true}); // data-cy="SummaryHeader_Files_Button" + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageParticipant.cy.ts b/cypress/e2e/Consultation/PageParticipant_2.cy.ts similarity index 60% rename from cypress/e2e/Consultation/PageParticipant.cy.ts rename to cypress/e2e/Consultation/PageParticipant_2.cy.ts index b202195e..5accedf9 100644 --- a/cypress/e2e/Consultation/PageParticipant.cy.ts +++ b/cypress/e2e/Consultation/PageParticipant_2.cy.ts @@ -6,29 +6,6 @@ beforeEach(() => { cy.visitParticipantEntity('pt-0dxdyebh'); }); -describe('Page d\'un participant - Valider les redirections', () => { - it('Studies', () => { - cy.get('a[class*="SummaryHeader_link"]').eq(0).clickAndWait({force: true}); // data-cy="SummaryHeader_Studies_Button" - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Biospecimens', () => { - cy.get('a[class*="SummaryHeader_link"]').eq(1).clickAndWait({force: true}); // data-cy="SummaryHeader_Biospecimens_Button" - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); - }); - - it('Files', () => { - cy.get('a[class*="SummaryHeader_link"]').eq(2).clickAndWait({force: true}); // data-cy="SummaryHeader_Files_Button" - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); - }); -}); - describe('Page d\'un participant - Vérifier les informations affichées', () => { it('Titre', () => { cy.get('[class*="EntityTitle"]').contains('pt-0dxdyebh'); @@ -215,157 +192,3 @@ describe('Page d\'un participant - Vérifier les informations affichées', () => cy.get('[id="files"] [data-row-key="LCMS Metabolomics"] td[class="ant-table-cell"]').eq(2).find('[style*="width: "]').should('exist'); }); }); - -describe('Page d\'un participant - Valider les liens disponibles', () => { - it('Lien dbGaP du panneau Summary', () => { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).invoke('text').then((invokeText) => { - if (!invokeText.includes('-')) { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); - }; - }); - }); - - it('Lien Family du panneau Family', () => { - cy.resetColumns('family'); - cy.get('[id="family"] [class="ant-collapse-header"] [href]').clickAndWait({force: true}); // data-cy="FamilyLink" - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Family ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('F0013').should('exist'); - }); - - it('Lien Participant du panneau Family', () => { - cy.resetColumns('family'); - cy.get('[data-row-key="pt-v66khv4x"] td[class="ant-table-cell"]').eq(0).find('[href]').clickAndWait({force: true}); - cy.get('[class*="EntityTitle"]').contains('pt-v66khv4x'); - }); - - it('Lien Mondo du panneau Diagnoses', () => { - cy.resetColumns('diagnosis'); - cy.get('[id="diagnosis"] td[class="ant-table-cell"]').eq(0).find('[href]') - .should('have.attr', 'href').and('match', /http:\/\/purl.obolibrary.org\/obo\/MONDO_(0005071|0004235|0005093|0100471|0005420|0100470|0007186|0005172|0004979|0011918|0002050)/); - }); - - it('Lien MONDO Term du panneau Diagnoses', () => { - cy.resetColumns('diagnosis'); - cy.get('[data-row-key="HTP0026.Anxiety.HP:0000739.MONDO:0011918.NA"] td[class="ant-table-cell"]').eq(3).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Diagnosis (MONDO)').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Anxiety (MONDO:0011918)').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); - - it('Lien HP du panneau Phenotypes', () => { - cy.resetColumns('phenotype'); - cy.get('[id="phenotype"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(0).find('[href]') - .should('have.attr', 'href', 'http://purl.obolibrary.org/obo/HP_0000739'); - }); - - it('Lien HPO Term du panneau Phenotypes', () => { - cy.resetColumns('phenotype'); - cy.get('[id="phenotype"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(3).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Phenotype (HPO)').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Anxiety (HP:0000739)').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); - - it('Lien DataExploration du panneau Biospecimens', () => { - cy.resetColumns('biospecimen'); - cy.get('[id="biospecimen"] [class="ant-collapse-header"] button').clickAndWait({force: true}); // data-cy="Biospecimens_RedirectLink" - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); - }); - - it('Lien Collection ID du panneau Biospecimens', () => { - cy.resetColumns('biospecimen'); - cy.get('[id="biospecimen"] [data-row-key="bs-e3g4mq8bcx"] [href]').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Collection ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-aezhntnkak').should('exist'); - }); - - it('Lien DataExploration du panneau Files', () => { - cy.get('[id="files"] [class="ant-collapse-header"] button').clickAndWait({force: true}); // data-cy="Files_RedirectLink" - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); - }); - - it('Lien Files de Genomics du panneau Files', () => { - cy.get('[id="files"] [data-row-key="Genomics"] td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Data Category').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Genomics').should('exist'); - }); - - it('Lien Files de Whole Genome Sequencing du panneau Files', () => { - cy.get('[id="files"] [data-row-key="Whole Genome Sequencing"] td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Experimental Strategy').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Whole Genome Sequencing').should('exist'); - }); -}); - -describe('Page d\'un participant - Valider les panneaux masquables', () => { - it('Panneau Summary', () => { - cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="summary"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Profile', () => { - cy.get('[id="profile"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="profile"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="profile"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="profile"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="profile"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Family', () => { - cy.get('[id="family"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="family"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="family"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="family"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="family"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Diagnoses', () => { - cy.get('[id="diagnosis"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="diagnosis"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="diagnosis"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="diagnosis"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="diagnosis"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Phenotypes', () => { - cy.get('[id="phenotype"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="phenotype"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="phenotype"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="phenotype"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="phenotype"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Biospecimens', () => { - cy.get('[id="biospecimen"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="biospecimen"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="biospecimen"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="biospecimen"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="biospecimen"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Files', () => { - cy.get('[id="files"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="files"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="files"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="files"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="files"] div[class*="ant-collapse-content-active"]').should('exist'); - }); -}); diff --git a/cypress/e2e/Consultation/PageParticipant_3.cy.ts b/cypress/e2e/Consultation/PageParticipant_3.cy.ts new file mode 100644 index 00000000..741f790e --- /dev/null +++ b/cypress/e2e/Consultation/PageParticipant_3.cy.ts @@ -0,0 +1,103 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); +}); + +describe('Page d\'un participant - Valider les liens disponibles', () => { + it('Lien dbGaP du panneau Summary', () => { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).invoke('text').then((invokeText) => { + if (!invokeText.includes('-')) { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); + }; + }); + }); + + it('Lien Family du panneau Family', () => { + cy.resetColumns('family'); + cy.get('[id="family"] [class="ant-collapse-header"] [href]').clickAndWait({force: true}); // data-cy="FamilyLink" + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Family ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('F0013').should('exist'); + }); + + it('Lien Participant du panneau Family', () => { + cy.resetColumns('family'); + cy.get('[data-row-key="pt-v66khv4x"] td[class="ant-table-cell"]').eq(0).find('[href]').clickAndWait({force: true}); + cy.get('[class*="EntityTitle"]').contains('pt-v66khv4x'); + }); + + it('Lien Mondo du panneau Diagnoses', () => { + cy.resetColumns('diagnosis'); + cy.get('[id="diagnosis"] td[class="ant-table-cell"]').eq(0).find('[href]') + .should('have.attr', 'href').and('match', /http:\/\/purl.obolibrary.org\/obo\/MONDO_(0005071|0004235|0005093|0100471|0005420|0100470|0007186|0005172|0004979|0011918|0002050)/); + }); + + it('Lien MONDO Term du panneau Diagnoses', () => { + cy.resetColumns('diagnosis'); + cy.get('[data-row-key="HTP0026.Anxiety.HP:0000739.MONDO:0011918.NA"] td[class="ant-table-cell"]').eq(3).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Diagnosis (MONDO)').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Anxiety (MONDO:0011918)').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); + + it('Lien HP du panneau Phenotypes', () => { + cy.resetColumns('phenotype'); + cy.get('[id="phenotype"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(0).find('[href]') + .should('have.attr', 'href', 'http://purl.obolibrary.org/obo/HP_0000739'); + }); + + it('Lien HPO Term du panneau Phenotypes', () => { + cy.resetColumns('phenotype'); + cy.get('[id="phenotype"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(3).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Phenotype (HPO)').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Anxiety (HP:0000739)').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); + + it('Lien DataExploration du panneau Biospecimens', () => { + cy.resetColumns('biospecimen'); + cy.get('[id="biospecimen"] [class="ant-collapse-header"] button').clickAndWait({force: true}); // data-cy="Biospecimens_RedirectLink" + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); + }); + + it('Lien Collection ID du panneau Biospecimens', () => { + cy.resetColumns('biospecimen'); + cy.get('[id="biospecimen"] [data-row-key="bs-e3g4mq8bcx"] [href]').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Collection ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-aezhntnkak').should('exist'); + }); + + it('Lien DataExploration du panneau Files', () => { + cy.get('[id="files"] [class="ant-collapse-header"] button').clickAndWait({force: true}); // data-cy="Files_RedirectLink" + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); + }); + + it('Lien Files de Genomics du panneau Files', () => { + cy.get('[id="files"] [data-row-key="Genomics"] td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Data Category').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Genomics').should('exist'); + }); + + it('Lien Files de Whole Genome Sequencing du panneau Files', () => { + cy.get('[id="files"] [data-row-key="Whole Genome Sequencing"] td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Experimental Strategy').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-0dxdyebh').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Whole Genome Sequencing').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageParticipant_4.cy.ts b/cypress/e2e/Consultation/PageParticipant_4.cy.ts new file mode 100644 index 00000000..49276577 --- /dev/null +++ b/cypress/e2e/Consultation/PageParticipant_4.cy.ts @@ -0,0 +1,65 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); +}); + +describe('Page d\'un participant - Valider les panneaux masquables', () => { + it('Panneau Summary', () => { + cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="summary"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Profile', () => { + cy.get('[id="profile"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="profile"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="profile"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="profile"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="profile"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Family', () => { + cy.get('[id="family"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="family"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="family"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="family"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="family"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Diagnoses', () => { + cy.get('[id="diagnosis"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="diagnosis"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="diagnosis"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="diagnosis"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="diagnosis"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Phenotypes', () => { + cy.get('[id="phenotype"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="phenotype"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="phenotype"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="phenotype"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="phenotype"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Biospecimens', () => { + cy.get('[id="biospecimen"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="biospecimen"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="biospecimen"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="biospecimen"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="biospecimen"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Files', () => { + cy.get('[id="files"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="files"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="files"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="files"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="files"] div[class*="ant-collapse-content-active"]').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageProfileSettings.cy.ts b/cypress/e2e/Consultation/PageProfileSettings_1.cy.ts similarity index 52% rename from cypress/e2e/Consultation/PageProfileSettings.cy.ts rename to cypress/e2e/Consultation/PageProfileSettings_1.cy.ts index fb661dae..f636edf9 100644 --- a/cypress/e2e/Consultation/PageProfileSettings.cy.ts +++ b/cypress/e2e/Consultation/PageProfileSettings_1.cy.ts @@ -123,147 +123,3 @@ describe('Page Profile Settings - Vérifier les informations affichées', () => cy.get('button[class*="ant-btn-dangerous"]').contains('Delete my account').should('exist'); }); }); - -describe('Page Profile Settings - Valider les liens disponibles', () => { - it('Lien du bouton View profile', () => { - cy.get('[class*="ProfileSettings_profileSettingsHeader"] button').clickAndWait({force: true}); // data-cy="ViewProfileButton" - cy.get('[class*="UserAvatar_userAvatarRound"]').should('exist'); // data-cy="AvatarHeader" - }); - - it('Bouton Discard changes de la section Identification', () => { - cy.get('input[id="first_name"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); - cy.get('input[id="last_name"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); - cy.get('input[id="public_email"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); - cy.get('input[id="linkedin"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(0).find('button[class*="ant-btn-text"]').clickAndWait({force: true}); - - cy.get('input[id="first_name"]').should('not.have.attr', 'value', 'Discard'); - cy.get('input[id="last_name"]').should('not.have.attr', 'value', 'Discard'); - cy.get('input[id="linkedin"]').should('not.have.attr', 'value', 'Discard'); - cy.get('input[id="public_email"]').should('not.have.attr', 'value', 'Discard'); - }); - - it('Checkbox Other de la section Role & Affiliation', () => { - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="other"]').check({force: true}).should('be.checked'); - - cy.get('label[for="other_role"]').should('exist'); - cy.get('input[id="other_role"]').should('exist'); - }); - - it('Checkbox No Affiliation de la section Role & Affiliation', () => { - cy.get('input[id="no_affiliation"]').uncheck({force: true}).should('not.be.checked'); - - cy.get('input[id="affiliation"]').should('exist'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('[class*="form_withCustomHelp"]').eq(1).contains('Provide institutional or organizational affiliation').should('exist'); - }); - - it('Bouton Discard changes de la section Role & Affiliation', () => { - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="researcher"]').uncheck({force: true}).should('not.be.checked'); - cy.get('input[id="no_affiliation"]').uncheck({force: true}).should('not.be.checked'); - cy.get('textarea[id="research_area_description"]').clear({force: true}).type('Discard', {force: true}).contains('Discard').should('exist'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('button[class*="ant-btn-text"]').click({force: true}); - - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="researcher"]').should('be.checked'); - cy.get('input[id="no_affiliation"]').should('be.checked'); - cy.get('textarea[id="research_area_description"]').should('not.have.attr', 'placeholder').contains(/^$/).should('exist'); - }); - - it('Checkbox Other de la section Research & Data Use', () => { - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').check({force: true}).should('be.checked'); - - cy.get('label[title="Please specify your use"]').should('exist'); - cy.get('textarea[id="other_data_use"]').should('exist'); - }); - - it('Bouton Discard changes de la section Research & Data Use', () => { - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').check({force: true}).should('be.checked'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('button[class*="ant-btn-text"]').clickAndWait({force: true}); - - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').should('not.be.checked'); - }); - - it('Lien Privacy Policy de la section Newsletter', () => { - cy.get('[class*="Newsletter_allFieldRequiredNotice"] [href]').should('have.attr', 'href', 'https://includedcc.org/policies'); - }); - - it('Checkbox Agree de la section Newsletter', () => { - cy.get('input[id="newsletter_subscription_status"]').check({force: true}).should('be.checked'); - cy.get('label[title="Which email address should we use?"]').should('exist'); - cy.get('input[id="newsletter_email"]').should('exist'); - }); - - it('Bouton Discard changes de la section Newsletter', () => { - cy.get('input[id="newsletter_subscription_status"]').check({force: true}).should('be.checked'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(3).find('button[class*="ant-btn-text"]').clickAndWait({force: true}); - - cy.get('input[id="newsletter_subscription_status"]').should('not.be.checked'); - cy.get('label[title="Which email address should we use?"]').should('not.exist'); - cy.get('input[id="newsletter_email"]').should('not.exist'); - }); - - it('Bouton Delete my account de la section Delete Account', () => { - cy.get('button[class*="ant-btn-dangerous"]').clickAndWait({force: true}); - - cy.get('[class="ant-modal-content"]').contains('Delete Account').should('exist'); - cy.get('[class="ant-modal-content"]').contains('Are you sure you want to permanently delete this account?').should('exist'); - cy.get('[class="ant-modal-content"] button[class*="ant-btn-default"]').contains('Cancel').should('exist'); - cy.get('[class="ant-modal-content"] button[class*="ant-btn-primary ant-btn-dangerous"]').contains('Delete').should('exist'); - - cy.get('[class="ant-modal-content"] button[class*="ant-btn-default"]').clickAndWait({force: true}); - cy.get('[class="ant-modal-content"]').should('not.exist'); - }); - - it('Bouton Save changes de la section Identification', () => { - cy.get('input[id="first_name"]').clear({force: true}).type('FirstNameEdit', {force: true}).should('have.attr', 'value', 'FirstNameEdit'); - cy.get('input[id="last_name"]').clear({force: true}).type('LastNameEdit', {force: true}).should('have.attr', 'value', 'LastNameEdit'); - cy.get('input[id="public_email"]').clear({force: true}).type('email@edit.com', {force: true}).should('have.attr', 'value', 'email@edit.com'); - cy.get('input[id="linkedin"]').clear({force: true}).type('https://www.linkedin.com/in/edit/', {force: true}).should('have.attr', 'value', 'https://www.linkedin.com/in/edit/'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(0).find('button[class*="ant-btn-primary"]').clickAndWait({force: true}); - cy.visitProfileViewPage(); - - cy.get('body').contains('FirstNameEdit').should('exist'); - cy.get('body').contains('LastNameEdit').should('exist'); - cy.get('[href="mailto:email@edit.com"]').should('exist'); - cy.get('[href="https://www.linkedin.com/in/edit/"]').should('exist'); - }); - - it('Bouton Save changes de la section Role & Affiliation', () => { - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="other"]').check({force: true}).should('be.checked'); - cy.get('input[id="other_role"]').clear({force: true}).type('OtherRoleEdit', {force: true}).should('have.attr', 'value', 'OtherRoleEdit'); - cy.get('input[id="no_affiliation"]').uncheck({force: true}).should('not.be.checked'); - cy.get('input[id="affiliation"]').clear({force: true}).type('AffiliationEdit', {force: true}).should('have.attr', 'value', 'AffiliationEdit'); - cy.get('textarea[id="research_area_description"]').clear({force: true}).type('ResearchAreaEdit', {force: true}).contains('ResearchAreaEdit').should('exist'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('button[class*="ant-btn-primary"]').clickAndWait({force: true}); - cy.visitProfileViewPage(); - - cy.get('body').contains('OtherRoleEdit').should('exist'); - cy.get('body').contains('AffiliationEdit').should('exist'); - cy.get('body').contains('ResearchAreaEdit').should('exist'); - }); - - it('Bouton Save changes de la section Research & Data Use', () => { - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').check({force: true}).should('be.checked'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('textarea[id="other_data_use"]').clear({force: true}).type('ResearchDataEdit', {force: true}).contains('ResearchDataEdit').should('exist'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('button[class*="ant-btn-primary"]').click({force: true}); - cy.visitProfileViewPage(); - - cy.get('body').contains('ResearchDataEdit').should('exist'); - }); - - //Ne fonctionne pas, le checkbox se décoche au Save changes - it.skip('Bouton Save changes de la section Newsletter', () => { - cy.intercept('PUT', '**/subscribe', { - statusCode: 200, - body: { success: true, message: 'Subscription successful' }, - }).as('subscribeNewsletter'); - - cy.get('input[id="newsletter_subscription_status"]').check({force: true}).should('be.checked'); - cy.get('input[id="newsletter_email"]').clear({force: true}).type('test@subscription.com', {force:true}).should('have.attr', 'value', 'test@subscription.com'); - cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(3).find('button[class*="ant-btn-primary"]').clickAndWait(); - cy.wait('@subscribeNewsletter').its('response.statusCode').should('eq', 200); - cy.visitProfileSettingsPage(); - - cy.get('input[id="newsletter_subscription_status"]').should('be.checked'); - cy.get('input[id="newsletter_email"]').should('have.attr', 'value', 'test@subscription.com'); - }); -}); diff --git a/cypress/e2e/Consultation/PageProfileSettings_2.cy.ts b/cypress/e2e/Consultation/PageProfileSettings_2.cy.ts new file mode 100644 index 00000000..2de9de5d --- /dev/null +++ b/cypress/e2e/Consultation/PageProfileSettings_2.cy.ts @@ -0,0 +1,148 @@ +/// +import '../../support/commands'; +import { oneMinute } from '../../support/utils'; + +beforeEach(() => { + cy.login(); + cy.visitProfileSettingsPage(); + cy.waitWhileSpin(oneMinute); +}); + +describe('Page Profile Settings - Valider les liens disponibles', () => { + it('Lien du bouton View profile', () => { + cy.get('[class*="ProfileSettings_profileSettingsHeader"] button').clickAndWait({force: true}); // data-cy="ViewProfileButton" + cy.get('[class*="UserAvatar_userAvatarRound"]').should('exist'); // data-cy="AvatarHeader" + }); + + it('Bouton Discard changes de la section Identification', () => { + cy.get('input[id="first_name"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); + cy.get('input[id="last_name"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); + cy.get('input[id="public_email"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); + cy.get('input[id="linkedin"]').clear({force: true}).type('Discard', {force: true}).should('have.attr', 'value', 'Discard'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(0).find('button[class*="ant-btn-text"]').clickAndWait({force: true}); + + cy.get('input[id="first_name"]').should('not.have.attr', 'value', 'Discard'); + cy.get('input[id="last_name"]').should('not.have.attr', 'value', 'Discard'); + cy.get('input[id="linkedin"]').should('not.have.attr', 'value', 'Discard'); + cy.get('input[id="public_email"]').should('not.have.attr', 'value', 'Discard'); + }); + + it('Checkbox Other de la section Role & Affiliation', () => { + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="other"]').check({force: true}).should('be.checked'); + + cy.get('label[for="other_role"]').should('exist'); + cy.get('input[id="other_role"]').should('exist'); + }); + + it('Checkbox No Affiliation de la section Role & Affiliation', () => { + cy.get('input[id="no_affiliation"]').uncheck({force: true}).should('not.be.checked'); + + cy.get('input[id="affiliation"]').should('exist'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('[class*="form_withCustomHelp"]').eq(1).contains('Provide institutional or organizational affiliation').should('exist'); + }); + + it('Bouton Discard changes de la section Role & Affiliation', () => { + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="researcher"]').uncheck({force: true}).should('not.be.checked'); + cy.get('input[id="no_affiliation"]').uncheck({force: true}).should('not.be.checked'); + cy.get('textarea[id="research_area_description"]').clear({force: true}).type('Discard', {force: true}).contains('Discard').should('exist'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('button[class*="ant-btn-text"]').click({force: true}); + + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="researcher"]').should('be.checked'); + cy.get('input[id="no_affiliation"]').should('be.checked'); + cy.get('textarea[id="research_area_description"]').should('not.have.attr', 'placeholder').contains(/^$/).should('exist'); + }); + + it('Checkbox Other de la section Research & Data Use', () => { + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').check({force: true}).should('be.checked'); + + cy.get('label[title="Please specify your use"]').should('exist'); + cy.get('textarea[id="other_data_use"]').should('exist'); + }); + + it('Bouton Discard changes de la section Research & Data Use', () => { + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').check({force: true}).should('be.checked'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('button[class*="ant-btn-text"]').clickAndWait({force: true}); + + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').should('not.be.checked'); + }); + + it('Lien Privacy Policy de la section Newsletter', () => { + cy.get('[class*="Newsletter_allFieldRequiredNotice"] [href]').should('have.attr', 'href', 'https://includedcc.org/policies'); + }); + + it('Checkbox Agree de la section Newsletter', () => { + cy.get('input[id="newsletter_subscription_status"]').check({force: true}).should('be.checked'); + cy.get('label[title="Which email address should we use?"]').should('exist'); + cy.get('input[id="newsletter_email"]').should('exist'); + }); + + it('Bouton Discard changes de la section Newsletter', () => { + cy.get('input[id="newsletter_subscription_status"]').check({force: true}).should('be.checked'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(3).find('button[class*="ant-btn-text"]').clickAndWait({force: true}); + + cy.get('input[id="newsletter_subscription_status"]').should('not.be.checked'); + cy.get('label[title="Which email address should we use?"]').should('not.exist'); + cy.get('input[id="newsletter_email"]').should('not.exist'); + }); + + it('Bouton Delete my account de la section Delete Account', () => { + cy.get('button[class*="ant-btn-dangerous"]').clickAndWait({force: true}); + + cy.get('[class="ant-modal-content"]').contains('Delete Account').should('exist'); + cy.get('[class="ant-modal-content"]').contains('Are you sure you want to permanently delete this account?').should('exist'); + cy.get('[class="ant-modal-content"] button[class*="ant-btn-default"]').contains('Cancel').should('exist'); + cy.get('[class="ant-modal-content"] button[class*="ant-btn-primary ant-btn-dangerous"]').contains('Delete').should('exist'); + + cy.get('[class="ant-modal-content"] button[class*="ant-btn-default"]').clickAndWait({force: true}); + cy.get('[class="ant-modal-content"]').should('not.exist'); + }); + + it('Bouton Save changes de la section Identification', () => { + cy.get('input[id="first_name"]').clear({force: true}).type('FirstNameEdit', {force: true}).should('have.attr', 'value', 'FirstNameEdit'); + cy.get('input[id="last_name"]').clear({force: true}).type('LastNameEdit', {force: true}).should('have.attr', 'value', 'LastNameEdit'); + cy.get('input[id="public_email"]').clear({force: true}).type('email@edit.com', {force: true}).should('have.attr', 'value', 'email@edit.com'); + cy.get('input[id="linkedin"]').clear({force: true}).type('https://www.linkedin.com/in/edit/', {force: true}).should('have.attr', 'value', 'https://www.linkedin.com/in/edit/'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(0).find('button[class*="ant-btn-primary"]').clickAndWait({force: true}); + cy.visitProfileViewPage(); + + cy.get('body').contains('FirstNameEdit').should('exist'); + cy.get('body').contains('LastNameEdit').should('exist'); + cy.get('[href="mailto:email@edit.com"]').should('exist'); + cy.get('[href="https://www.linkedin.com/in/edit/"]').should('exist'); + }); + + it('Bouton Save changes de la section Role & Affiliation', () => { + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('input[value="other"]').check({force: true}).should('be.checked'); + cy.get('input[id="other_role"]').clear({force: true}).type('OtherRoleEdit', {force: true}).should('have.attr', 'value', 'OtherRoleEdit'); + cy.get('input[id="no_affiliation"]').uncheck({force: true}).should('not.be.checked'); + cy.get('input[id="affiliation"]').clear({force: true}).type('AffiliationEdit', {force: true}).should('have.attr', 'value', 'AffiliationEdit'); + cy.get('textarea[id="research_area_description"]').clear({force: true}).type('ResearchAreaEdit', {force: true}).contains('ResearchAreaEdit').should('exist'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(1).find('button[class*="ant-btn-primary"]').clickAndWait({force: true}); + cy.visitProfileViewPage(); + + cy.get('body').contains('OtherRoleEdit').should('exist'); + cy.get('body').contains('AffiliationEdit').should('exist'); + cy.get('body').contains('ResearchAreaEdit').should('exist'); + }); + + it('Bouton Save changes de la section Research & Data Use', () => { + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('input[value="other"]').check({force: true}).should('be.checked'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('textarea[id="other_data_use"]').clear({force: true}).type('ResearchDataEdit', {force: true}).contains('ResearchDataEdit').should('exist'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(2).find('button[class*="ant-btn-primary"]').click({force: true}); + cy.visitProfileViewPage(); + + cy.get('body').contains('ResearchDataEdit').should('exist'); + }); + + it('Bouton Save changes de la section Newsletter', () => { + cy.intercept('PUT', '**/subscribe', { + statusCode: 200, + body: { success: true, message: 'Subscription successful' }, + }).as('subscribeNewsletter'); + + cy.get('input[id="newsletter_subscription_status"]').check({force: true}).should('be.checked'); + cy.get('input[id="newsletter_email"]').clear({force: true}).type('test@subscription.com', {force:true}).should('have.attr', 'value', 'test@subscription.com'); + cy.get('[class*="Gridcard_fuiCardWrapper"]').eq(3).find('button[class*="ant-btn-primary"]').clickAndWait(); + cy.wait('@subscribeNewsletter').its('response.statusCode').should('eq', 200); + }); +}); diff --git a/cypress/e2e/Consultation/PageStudy_1.cy.ts b/cypress/e2e/Consultation/PageStudy_1.cy.ts new file mode 100644 index 00000000..a2d7839d --- /dev/null +++ b/cypress/e2e/Consultation/PageStudy_1.cy.ts @@ -0,0 +1,30 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitStudyEntity('HTP', 1); +}); + +describe('Page d\'une étude - Valider les redirections', () => { + it('Participants', () => { + cy.get('button[class*="SummaryHeader_item"]').eq(0).clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Biospecimens', () => { + cy.get('button[class*="SummaryHeader_item"]').eq(1).clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Files', () => { + cy.get('button[class*="SummaryHeader_item"]').eq(2).clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageStudy.cy.ts b/cypress/e2e/Consultation/PageStudy_2.cy.ts similarity index 73% rename from cypress/e2e/Consultation/PageStudy.cy.ts rename to cypress/e2e/Consultation/PageStudy_2.cy.ts index 4ddc336d..e63c8c29 100644 --- a/cypress/e2e/Consultation/PageStudy.cy.ts +++ b/cypress/e2e/Consultation/PageStudy_2.cy.ts @@ -6,29 +6,6 @@ beforeEach(() => { cy.visitStudyEntity('HTP', 1); }); -describe('Page d\'une étude - Valider les redirections', () => { - it('Participants', () => { - cy.get('button[class*="SummaryHeader_item"]').eq(0).clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Biospecimens', () => { - cy.get('button[class*="SummaryHeader_item"]').eq(1).clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Files', () => { - cy.get('button[class*="SummaryHeader_item"]').eq(2).clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); -}); - describe('Page d\'une étude - Vérifier les informations affichées', () => { it('Titre', () => { cy.get('[class*="EntityTitleLogo_logo"] [src*="study-logo-HTP"]').should('exist'); @@ -252,142 +229,3 @@ describe('Page d\'une étude - Vérifier les informations affichées', () => { cy.get('[id="data_file"] [data-row-key="3"]').eq(1).find('td[class="ant-table-cell"]').eq(2).find('[style*="width: "]').should('exist'); }); }); - -describe('Page d\'une étude - Valider les liens disponibles', () => { - it('Lien dbGaP du panneau Summary', () => { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).invoke('text').then((invokeText) => { - if (!invokeText.includes('-')) { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); - }; - }); - }); - - it('Lien Study Website du panneau Summary', () => { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(12).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/www.trisome.org/); - }); - - it('Lien Publication du panneau Summary', () => { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(13).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/pubmed.ncbi.nlm.nih.gov\/38942750(|\/)/); - }); - - it('Lien \'See more\' de Publication du panneau Summary', () => { - cy.get('[class*="PubModal_modalWrapper"]').should('not.exist'); - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(13).contains('See more').clickAndWait({force: true}); - cy.get('[class*="PubModal_modalWrapper"]').should('exist'); - }); - - it('Lien Virtual Biorepository Email du panneau Summary', () => { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(17).find('[href]') - .should('have.attr', 'href', 'mailto:dsresearch@cuanschutz.edu'); - }); - - it('Lien Virtual Biorepository URL du panneau Summary', () => { - cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(18).find('[href]') - .should('have.attr', 'href', 'https://redcap.link/HTPVBRrequest'); - }); - - it('Lien DataExploration du panneau Summary Statistics', () => { - cy.get('[id="statistic"] [class="ant-collapse-header"] button').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Lien Duo de l\'Access Limitation du panneau Data Access', () => { - cy.get('[id="data_access"] [class="ant-descriptions-item-content"]').eq(0).find('[href]') - .should('have.attr', 'href', 'http://purl.obolibrary.org/obo/DUO_0000042'); - }); - - it('Lien DataExploration du panneau HTP Whole Blood RNAseq (2020)', () => { - cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { - if ($el.text().includes('HTP Whole Blood RNAseq (2020)')) { - cy.wrap($el).as('datasetPanel'); - } - }); - - cy.get('@datasetPanel').find('[class="ant-collapse-header"] button').eq(0).clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Dataset').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP Whole Blood RNAseq (2020)').should('exist'); - }); - - it('Lien Publication du panneau HTP Whole Blood RNAseq (2020)', () => { - cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { - if ($el.text().includes('HTP Whole Blood RNAseq (2020)')) { - cy.wrap($el).as('datasetPanel'); - } - }); - - cy.get('@datasetPanel').find('[class="ant-descriptions-item-content"]').eq(8).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/pubmed.ncbi.nlm.nih.gov\/37379383(|\/)/); - }); - - it('Lien Files de Gene Expression Quantifications du panneau Files', () => { - cy.get('[id="data_file"] [data-row-key="1"] td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Data Type').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Gene Expression Quantifications').should('exist'); - }); - - it('Lien Files de RNA-Seq du panneau Files', () => { - cy.get('[id="data_file"] [data-row-key="0"]').eq(1).find('td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Experimental Strategy').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('RNA-Seq').should('exist'); - }); -}); - -describe('Page d\'une étude - Valider les panneaux masquables', () => { - it('Panneau Summary', () => { - cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="summary"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Statistic', () => { - cy.get('[id="statistic"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="statistic"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="statistic"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="statistic"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="statistic"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Data Access', () => { - cy.get('[id="data_access"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="data_access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data_access"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="data_access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data_access"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau HTP Whole Blood RNAseq (2020)', () => { - cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { - if ($el.text().includes('HTP Whole Blood RNAseq (2020)')) { - cy.wrap($el).as('datasetPanel'); - } - }); - - cy.get('@datasetPanel').find('div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('@datasetPanel').find('span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('@datasetPanel').find('div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('@datasetPanel').find('span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('@datasetPanel').find('div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Files', () => { - cy.get('[id="data_file"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="data_file"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data_file"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="data_file"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="data_file"] div[class*="ant-collapse-content-active"]').should('exist'); - }); -}); diff --git a/cypress/e2e/Consultation/PageStudy_3.cy.ts b/cypress/e2e/Consultation/PageStudy_3.cy.ts new file mode 100644 index 00000000..9146ee0b --- /dev/null +++ b/cypress/e2e/Consultation/PageStudy_3.cy.ts @@ -0,0 +1,98 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitStudyEntity('HTP', 1); +}); + +describe('Page d\'une étude - Valider les liens disponibles', () => { + it('Lien dbGaP du panneau Summary', () => { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).invoke('text').then((invokeText) => { + if (!invokeText.includes('-')) { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(3).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); + }; + }); + }); + + it('Lien Study Website du panneau Summary', () => { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(12).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/www.trisome.org/); + }); + + it('Lien Publication du panneau Summary', () => { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(13).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/pubmed.ncbi.nlm.nih.gov\/38942750(|\/)/); + }); + + it('Lien \'See more\' de Publication du panneau Summary', () => { + cy.get('[class*="PubModal_modalWrapper"]').should('not.exist'); + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(13).contains('See more').clickAndWait({force: true}); + cy.get('[class*="PubModal_modalWrapper"]').should('exist'); + }); + + it('Lien Virtual Biorepository Email du panneau Summary', () => { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(17).find('[href]') + .should('have.attr', 'href', 'mailto:dsresearch@cuanschutz.edu'); + }); + + it('Lien Virtual Biorepository URL du panneau Summary', () => { + cy.get('[id="summary"] [class="ant-descriptions-item-content"]').eq(18).find('[href]') + .should('have.attr', 'href', 'https://redcap.link/HTPVBRrequest'); + }); + + it('Lien DataExploration du panneau Summary Statistics', () => { + cy.get('[id="statistic"] [class="ant-collapse-header"] button').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Lien Duo de l\'Access Limitation du panneau Data Access', () => { + cy.get('[id="data_access"] [class="ant-descriptions-item-content"]').eq(0).find('[href]') + .should('have.attr', 'href', 'http://purl.obolibrary.org/obo/DUO_0000042'); + }); + + it('Lien DataExploration du panneau HTP Whole Blood RNAseq (2020)', () => { + cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { + if ($el.text().includes('HTP Whole Blood RNAseq (2020)')) { + cy.wrap($el).as('datasetPanel'); + } + }); + + cy.get('@datasetPanel').find('[class="ant-collapse-header"] button').eq(0).clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Dataset').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP Whole Blood RNAseq (2020)').should('exist'); + }); + + it('Lien Publication du panneau HTP Whole Blood RNAseq (2020)', () => { + cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { + if ($el.text().includes('HTP Whole Blood RNAseq (2020)')) { + cy.wrap($el).as('datasetPanel'); + } + }); + + cy.get('@datasetPanel').find('[class="ant-descriptions-item-content"]').eq(8).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/pubmed.ncbi.nlm.nih.gov\/37379383(|\/)/); + }); + + it('Lien Files de Gene Expression Quantifications du panneau Files', () => { + cy.get('[id="data_file"] [data-row-key="1"] td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Data Type').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Gene Expression Quantifications').should('exist'); + }); + + it('Lien Files de RNA-Seq du panneau Files', () => { + cy.get('[id="data_file"] [data-row-key="0"]').eq(1).find('td[class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Experimental Strategy').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('RNA-Seq').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageStudy_4.cy.ts b/cypress/e2e/Consultation/PageStudy_4.cy.ts new file mode 100644 index 00000000..f40e9db7 --- /dev/null +++ b/cypress/e2e/Consultation/PageStudy_4.cy.ts @@ -0,0 +1,55 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitStudyEntity('HTP', 1); +}); + +describe('Page d\'une étude - Valider les panneaux masquables', () => { + it('Panneau Summary', () => { + cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="summary"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="summary"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="summary"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Statistic', () => { + cy.get('[id="statistic"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="statistic"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="statistic"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="statistic"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="statistic"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Data Access', () => { + cy.get('[id="data_access"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="data_access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data_access"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="data_access"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data_access"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau HTP Whole Blood RNAseq (2020)', () => { + cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { + if ($el.text().includes('HTP Whole Blood RNAseq (2020)')) { + cy.wrap($el).as('datasetPanel'); + } + }); + + cy.get('@datasetPanel').find('div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('@datasetPanel').find('span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('@datasetPanel').find('div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('@datasetPanel').find('span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('@datasetPanel').find('div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Files', () => { + cy.get('[id="data_file"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="data_file"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data_file"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="data_file"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="data_file"] div[class*="ant-collapse-content-active"]').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageVariant.cy.ts b/cypress/e2e/Consultation/PageVariant_1.cy.ts similarity index 63% rename from cypress/e2e/Consultation/PageVariant.cy.ts rename to cypress/e2e/Consultation/PageVariant_1.cy.ts index a5ce8860..7fda8d35 100644 --- a/cypress/e2e/Consultation/PageVariant.cy.ts +++ b/cypress/e2e/Consultation/PageVariant_1.cy.ts @@ -198,173 +198,3 @@ describe('Page d\'un variant - Vérifier les informations affichées', () => { cy.get('[data-row-key="3-s-l-c-25-a-24"] td[class="ant-table-cell"]').eq(2).contains('Gorlin-Chaudhry-Moss Syndrome (GCMS); Syndrome With Hypertrichosis, Progeroid Appearance, And Mitochondrial Dysfunction').should('exist'); }); }); - -describe('Page d\'un variant - Valider les liens disponibles', () => { - it('Lien Gene du panneau Summary', () => { - // data-cy="Summary_Gene_ExternalLink" - cy.get('a[class*="VariantEntity_symbolLink"]').eq(0).should('have.attr', 'href', 'https://omim.org/entry/608744'); - }); - - it('Lien Ensembl du panneau Summary', () => { - // data-cy="Summary_Ensembl_ExternalLink" - cy.get('a[class*="VariantEntity_ensemblLink"]').eq(0).should('have.attr', 'href', 'https://www.ensembl.org/id/ENST00000370041'); - }); - - it('Lien ClinVar du panneau Summary', () => { - cy.get('div[class*="EntityVariantSummary_bannerWrapper"] [class="ant-space-item"]').eq(7).find('[class*="ant-tag-green"] a') // data-cy="Summary_ClinVar_ExternalLink" - .should('have.attr', 'href', 'https://www.ncbi.nlm.nih.gov/clinvar/variation/1267873'); - }); - - it('Lien gnomAD du panneau Summary', () => { - cy.get('div[class*="EntityVariantSummary_bannerWrapper"] [class="ant-space-item"]').eq(12).find('a') // data-cy="Summary_gnomAD_ExternalLink" - .should('have.attr', 'href', 'https://gnomad.broadinstitute.org/variant/1-108192590-T-C?dataset=gnomad_r3'); - }); - - it('Lien Ensembl Transcript du panneau Summary', () => { - cy.get('div[class*="EntityVariantSummary_infoWrapper"] div[class*="ant-space-item"]').eq(0).find('a') // data-cy="Summary_Ensembl_Transcript_ExternalLink" - .should('have.attr', 'href', 'https://www.ensembl.org/id/ENST00000370041'); - }); - - it('Lien dbSNP du panneau Summary', () => { - cy.get('div[class*="EntityVariantSummary_infoWrapper"] a').eq(1) // data-cy="Summary_sbSNP_ExternalLink" - .should('have.attr', 'href', 'https://www.ncbi.nlm.nih.gov/snp/rs79735952'); - }); - - it('Lien OMIM du panneau Summary', () => { - cy.get('div[class*="EntityVariantSummary_omim"] [class*="ant-descriptions-item-label"]').eq(0).find('a') // data-cy="Summary_Omim_ExternalLink" - .should('have.attr', 'href', 'https://www.omim.org/entry/612289'); - }); - - it('Ouvrir et refermer la nested table du panneau Transcripts', () => { - cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); - cy.get('[id="consequence"] tr[class*="ant-table-expanded-row"]').eq(0).should('have.css', 'display', 'table-row'); - cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); - cy.get('[id="consequence"] tr[class*="ant-table-expanded-row"]').eq(0).should('have.css', 'display', 'none'); - }); - - it('Lien du gène du panneau Transcripts', () => { - cy.get('[id="consequence"] tbody td[class="ant-table-cell"]').eq(0).find('[href]').eq(0).should('have.attr', 'href', 'https://www.omim.org/entry/608744'); - }); - - it('Lien \'See more\' de Predictions du panneau Transcripts', () => { - cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See more').clickAndWait({force: true}); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(4).contains('CADD (Raw)').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(5).contains('0.790136').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(6).contains('CADD (Phred)').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(7).contains('9.294').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(8).contains('DANN').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(9).contains('0.9434897325387575').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(10).contains('REVEL').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(11).contains('0.068').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(12).contains('PolyPhen-2 HVAR').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(13).contains('Benign').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(13).contains('0.056').should('exist'); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See less').clickAndWait({force: true}); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(4).should('not.exist'); - }); - - it('Lien du transcript du panneau Transcripts', () => { - cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); - cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(5).find('a').should('have.attr', 'href', 'https://www.ensembl.org/id/ENST00000370041'); - }); - - it('Lien Studies du panneau INCLUDE Studies', () => { - cy.get('[id="frequency"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(0).find('a').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('DS360-CHD').should('exist'); - }); - - it('Lien Participants du panneau INCLUDE Studies', () => { - cy.get('[id="frequency"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(1).find('a').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PT').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); - - it('Lien TopMed du panneau Public Cohorts', () => { - cy.get('[data-row-key="topmed"] td[class="ant-table-cell"]').eq(0).find('[href]') - .should('have.attr', 'href', 'https://bravo.sph.umich.edu/freeze8/hg38/variant/snv/1-108192590-T-C'); - }); - - it('Lien gnomAD Genome (v3.1.2) du panneau Public Cohorts', () => { - cy.get('[data-row-key="gnomadGenomes3"] td[class="ant-table-cell"]').eq(0).find('[href]') - .should('have.attr', 'href', 'https://gnomad.broadinstitute.org/variant/1-108192590-T-C?dataset=gnomad_r3'); - }); - - it('Lien ClinVar du panneau ClinVar', () => { - cy.get('[id="pathogenicity"] div[class="ant-collapse-header"] [href]') // data-cy="Pathogenicity_ClinVar_1267873_ExternalLink" - .should('have.attr', 'href', 'https://www.ncbi.nlm.nih.gov/clinvar/variation/1267873'); - }); - - it('Lien de la condition Orphanet du panneau Gene - Phenotype Association', () => { - cy.get('[data-row-key="0-s-l-c-25-a-24"] td[class="ant-table-cell"]').eq(2).find('[href]') - .should('have.attr', 'href', 'https://www.orpha.net/consor/cgi-bin/Disease_Search.php?lng=EN&data_id=3173'); - }); - - it('Lien OMIM du gène du panneau Gene - Phenotype Association', () => { - cy.get('[data-row-key*="1-s-l-c-25-a-24-608744"] td[class="ant-table-cell"]').eq(1).find('[href]') - .should('have.attr', 'href', 'https://www.omim.org/entry/608744'); - }); - - it('Lien OMIM de la condition du panneau Gene - Phenotype Association', () => { - cy.get('[data-row-key*="1-s-l-c-25-a-24-608744"] td[class="ant-table-cell"]').eq(2).find('[href]').first() - .should('have.attr', 'href', 'https://www.omim.org/entry/612289'); - }); - - it('Lien HPO de la condition du panneau Gene - Phenotype Association', () => { - cy.get('[data-row-key*="2-s-l-c-25-a-24"] td[class="ant-table-cell"]').eq(2).find('[href]').eq(0) - .should('have.attr', 'href', 'https://hpo.jax.org/app/browse/term/HP:0007740'); - }); - - it('Lien \'See more\' de la condition du panneau Gene - Phenotype Association', () => { - cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('See more').clickAndWait({force: true}); - cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('Abnormal Heart Morphology').should('exist'); - cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('See less').clickAndWait({force: true}); - cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('Abnormal Heart Morphology').should('not.exist'); - }); -}); - -describe('Page d\'un variant - Valider les panneaux masquables', () => { - it('Panneau Transcripts', () => { - cy.get('[id="consequence"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="consequence"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="consequence"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="consequence"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="consequence"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau INCLUDE Studies', () => { - cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Public Cohorts', () => { - cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau ClinVar', () => { - cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - }); - - it('Panneau Gene - Phenotype Association', () => { - cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); - }); -}); diff --git a/cypress/e2e/Consultation/PageVariant_2.cy.ts b/cypress/e2e/Consultation/PageVariant_2.cy.ts new file mode 100644 index 00000000..86bd609c --- /dev/null +++ b/cypress/e2e/Consultation/PageVariant_2.cy.ts @@ -0,0 +1,135 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantEntityPage('1-108192590-T-C', 1); +}); + +describe('Page d\'un variant - Valider les liens disponibles', () => { + it('Lien Gene du panneau Summary', () => { + // data-cy="Summary_Gene_ExternalLink" + cy.get('a[class*="VariantEntity_symbolLink"]').eq(0).should('have.attr', 'href', 'https://omim.org/entry/608744'); + }); + + it('Lien Ensembl du panneau Summary', () => { + // data-cy="Summary_Ensembl_ExternalLink" + cy.get('a[class*="VariantEntity_ensemblLink"]').eq(0).should('have.attr', 'href', 'https://www.ensembl.org/id/ENST00000370041'); + }); + + it('Lien ClinVar du panneau Summary', () => { + cy.get('div[class*="EntityVariantSummary_bannerWrapper"] [class="ant-space-item"]').eq(7).find('[class*="ant-tag-green"] a') // data-cy="Summary_ClinVar_ExternalLink" + .should('have.attr', 'href', 'https://www.ncbi.nlm.nih.gov/clinvar/variation/1267873'); + }); + + it('Lien gnomAD du panneau Summary', () => { + cy.get('div[class*="EntityVariantSummary_bannerWrapper"] [class="ant-space-item"]').eq(12).find('a') // data-cy="Summary_gnomAD_ExternalLink" + .should('have.attr', 'href', 'https://gnomad.broadinstitute.org/variant/1-108192590-T-C?dataset=gnomad_r3'); + }); + + it('Lien Ensembl Transcript du panneau Summary', () => { + cy.get('div[class*="EntityVariantSummary_infoWrapper"] div[class*="ant-space-item"]').eq(0).find('a') // data-cy="Summary_Ensembl_Transcript_ExternalLink" + .should('have.attr', 'href', 'https://www.ensembl.org/id/ENST00000370041'); + }); + + it('Lien dbSNP du panneau Summary', () => { + cy.get('div[class*="EntityVariantSummary_infoWrapper"] a').eq(1) // data-cy="Summary_sbSNP_ExternalLink" + .should('have.attr', 'href', 'https://www.ncbi.nlm.nih.gov/snp/rs79735952'); + }); + + it('Lien OMIM du panneau Summary', () => { + cy.get('div[class*="EntityVariantSummary_omim"] [class*="ant-descriptions-item-label"]').eq(0).find('a') // data-cy="Summary_Omim_ExternalLink" + .should('have.attr', 'href', 'https://www.omim.org/entry/612289'); + }); + + it('Ouvrir et refermer la nested table du panneau Transcripts', () => { + cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); + cy.get('[id="consequence"] tr[class*="ant-table-expanded-row"]').eq(0).should('have.css', 'display', 'table-row'); + cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); + cy.get('[id="consequence"] tr[class*="ant-table-expanded-row"]').eq(0).should('have.css', 'display', 'none'); + }); + + it('Lien du gène du panneau Transcripts', () => { + cy.get('[id="consequence"] tbody td[class="ant-table-cell"]').eq(0).find('[href]').eq(0).should('have.attr', 'href', 'https://www.omim.org/entry/608744'); + }); + + it('Lien \'See more\' de Predictions du panneau Transcripts', () => { + cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See more').clickAndWait({force: true}); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(4).contains('CADD (Raw)').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(5).contains('0.790136').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(6).contains('CADD (Phred)').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(7).contains('9.294').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(8).contains('DANN').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(9).contains('0.9434897325387575').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(10).contains('REVEL').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(11).contains('0.068').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(12).contains('PolyPhen-2 HVAR').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(13).contains('Benign').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(13).contains('0.056').should('exist'); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See less').clickAndWait({force: true}); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(3).find('span[class*="ant-typography"]').eq(4).should('not.exist'); + }); + + it('Lien du transcript du panneau Transcripts', () => { + cy.get('[id="consequence"] tbody td[class*="ant-table-row-expand-icon-cell"]').eq(0).find('button').clickAndWait({force: true}); + cy.get('[id="consequence"] div[class*="VariantEntity_expandedTable"] tbody td[class*="ant-table-cell"]').eq(5).find('a').should('have.attr', 'href', 'https://www.ensembl.org/id/ENST00000370041'); + }); + + it('Lien Studies du panneau INCLUDE Studies', () => { + cy.get('[id="frequency"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(0).find('a').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('DS360-CHD').should('exist'); + }); + + it('Lien Participants du panneau INCLUDE Studies', () => { + cy.get('[id="frequency"] tr[class*="ant-table-row"]').eq(0).find('td[class="ant-table-cell"]').eq(1).find('a').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PT').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); + + it('Lien TopMed du panneau Public Cohorts', () => { + cy.get('[data-row-key="topmed"] td[class="ant-table-cell"]').eq(0).find('[href]') + .should('have.attr', 'href', 'https://bravo.sph.umich.edu/freeze8/hg38/variant/snv/1-108192590-T-C'); + }); + + it('Lien gnomAD Genome (v3.1.2) du panneau Public Cohorts', () => { + cy.get('[data-row-key="gnomadGenomes3"] td[class="ant-table-cell"]').eq(0).find('[href]') + .should('have.attr', 'href', 'https://gnomad.broadinstitute.org/variant/1-108192590-T-C?dataset=gnomad_r3'); + }); + + it('Lien ClinVar du panneau ClinVar', () => { + cy.get('[id="pathogenicity"] div[class="ant-collapse-header"] [href]') // data-cy="Pathogenicity_ClinVar_1267873_ExternalLink" + .should('have.attr', 'href', 'https://www.ncbi.nlm.nih.gov/clinvar/variation/1267873'); + }); + + it('Lien de la condition Orphanet du panneau Gene - Phenotype Association', () => { + cy.get('[data-row-key="0-s-l-c-25-a-24"] td[class="ant-table-cell"]').eq(2).find('[href]') + .should('have.attr', 'href', 'https://www.orpha.net/consor/cgi-bin/Disease_Search.php?lng=EN&data_id=3173'); + }); + + it('Lien OMIM du gène du panneau Gene - Phenotype Association', () => { + cy.get('[data-row-key*="1-s-l-c-25-a-24-608744"] td[class="ant-table-cell"]').eq(1).find('[href]') + .should('have.attr', 'href', 'https://www.omim.org/entry/608744'); + }); + + it('Lien OMIM de la condition du panneau Gene - Phenotype Association', () => { + cy.get('[data-row-key*="1-s-l-c-25-a-24-608744"] td[class="ant-table-cell"]').eq(2).find('[href]').first() + .should('have.attr', 'href', 'https://www.omim.org/entry/612289'); + }); + + it('Lien HPO de la condition du panneau Gene - Phenotype Association', () => { + cy.get('[data-row-key*="2-s-l-c-25-a-24"] td[class="ant-table-cell"]').eq(2).find('[href]').eq(0) + .should('have.attr', 'href', 'https://hpo.jax.org/app/browse/term/HP:0007740'); + }); + + it('Lien \'See more\' de la condition du panneau Gene - Phenotype Association', () => { + cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('See more').clickAndWait({force: true}); + cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('Abnormal Heart Morphology').should('exist'); + cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('See less').clickAndWait({force: true}); + cy.get('[data-row-key="2-s-l-c-25-a-24"]').contains('Abnormal Heart Morphology').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Consultation/PageVariant_3.cy.ts b/cypress/e2e/Consultation/PageVariant_3.cy.ts new file mode 100644 index 00000000..c98d6287 --- /dev/null +++ b/cypress/e2e/Consultation/PageVariant_3.cy.ts @@ -0,0 +1,49 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantEntityPage('1-108192590-T-C', 1); +}); + +describe('Page d\'un variant - Valider les panneaux masquables', () => { + it('Panneau Transcripts', () => { + cy.get('[id="consequence"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="consequence"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="consequence"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="consequence"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="consequence"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau INCLUDE Studies', () => { + cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="frequency"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Public Cohorts', () => { + cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="EntityTable_container"]').eq(2).find('[class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau ClinVar', () => { + cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="pathogenicity"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + }); + + it('Panneau Gene - Phenotype Association', () => { + cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[id="condition"] [class*="Collapse_fuiCollapse"] div[class*="ant-collapse-content-active"]').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauBiospecimens_1.cy.ts b/cypress/e2e/Consultation/TableauBiospecimens_1.cy.ts new file mode 100644 index 00000000..eaddc325 --- /dev/null +++ b/cypress/e2e/Consultation/TableauBiospecimens_1.cy.ts @@ -0,0 +1,41 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('biospecimens', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.showColumn('External Sample ID'); + cy.showColumn('Volume'); + cy.showColumn('Volume Unit'); + cy.showColumn('Laboratory Procedure'); + cy.showColumn('Biospecimen Storage'); +}); + +describe('Page Data Exploration (Biospecimens) - Vérifier les informations affichées', () => { + it('Titre', () => { + cy.get('[class*="DataExploration_title"]').contains('Data Exploration'); // data-cy="Title_DataExploration" + }); + + it('Tableau', () => { + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(1).contains('bs-03ynynfs').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(2).contains('HTP').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(3).contains('RNA').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(4).contains('bs-3m4a3fy3zm').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(5).contains('RNA').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(6).contains('pt-as0aepqm').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(7).contains('bs-m623h3mrgg').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(8).contains('Peripheral Whole Blood').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(9).contains('bs-ag3azt3gmq').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('28').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('years').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('139').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('days').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(11).contains('HTP0577A_PAXgeneWholeBloodRNA').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(12).contains('0.08').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(13).contains('mL').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(14).contains('Yes').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(15).contains('Qiagen PAXgene Blood RNA Kit').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(16).contains('-80C Freezer').should('exist'); + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(17).contains(/\d{1}/).should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauBiospecimens_2.cy.ts b/cypress/e2e/Consultation/TableauBiospecimens_2.cy.ts new file mode 100644 index 00000000..6898131b --- /dev/null +++ b/cypress/e2e/Consultation/TableauBiospecimens_2.cy.ts @@ -0,0 +1,34 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('biospecimens', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.showColumn('External Sample ID'); + cy.showColumn('Volume'); + cy.showColumn('Volume Unit'); + cy.showColumn('Laboratory Procedure'); + cy.showColumn('Biospecimen Storage'); +}); + +describe('Page Data Exploration (Biospecimens) - Valider les liens disponibles', () => { + it('Lien Participant ID du tableau', () => { + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(6).find('[href]').clickAndWait({force: true}); + cy.get('[id="participant-entity-page"]').should('exist'); + cy.get('[class*="EntityTitle"]').contains('pt-as0aepqm'); + }); + + it('Lien Collection ID du tableau', () => { + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(7).find('[type="link"]').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.validatePillSelectedQuery('Collection ID', ['Bs-m623h3mrgg'], 1); + }); + + it('Lien Files du tableau', () => { + cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(17).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Sample ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-03ynynfs').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); +}); diff --git a/cypress/e2e/Consultation/TableauBiospecimens.cy.ts b/cypress/e2e/Consultation/TableauBiospecimens_3.cy.ts similarity index 55% rename from cypress/e2e/Consultation/TableauBiospecimens.cy.ts rename to cypress/e2e/Consultation/TableauBiospecimens_3.cy.ts index c4ce1b06..2df9c92f 100644 --- a/cypress/e2e/Consultation/TableauBiospecimens.cy.ts +++ b/cypress/e2e/Consultation/TableauBiospecimens_3.cy.ts @@ -3,87 +3,15 @@ import '../../support/commands'; beforeEach(() => { cy.login(); -}); - -describe('Page Data Exploration (Biospecimens) - Vérifier les informations affichées', () => { - beforeEach(() => { - cy.visitDataExploration('biospecimens', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); - cy.showColumn('External Sample ID'); - cy.showColumn('Volume'); - cy.showColumn('Volume Unit'); - cy.showColumn('Laboratory Procedure'); - cy.showColumn('Biospecimen Storage'); - }); - - it('Titre', () => { - cy.get('[class*="DataExploration_title"]').contains('Data Exploration'); // data-cy="Title_DataExploration" - }); - - it('Tableau', () => { - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(1).contains('bs-03ynynfs').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(2).contains('HTP').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(3).contains('RNA').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(4).contains('bs-3m4a3fy3zm').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(5).contains('RNA').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(6).contains('pt-as0aepqm').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(7).contains('bs-m623h3mrgg').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(8).contains('Peripheral Whole Blood').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(9).contains('bs-ag3azt3gmq').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('28').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('years').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('139').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(10).contains('days').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(11).contains('HTP0577A_PAXgeneWholeBloodRNA').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(12).contains('0.08').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(13).contains('mL').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(14).contains('Yes').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(15).contains('Qiagen PAXgene Blood RNA Kit').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(16).contains('-80C Freezer').should('exist'); - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(17).contains(/\d{1}/).should('exist'); - }); -}); - -describe('Page Data Exploration (Biospecimens) - Valider les liens disponibles', () => { - beforeEach(() => { - cy.visitDataExploration('biospecimens', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); - cy.showColumn('External Sample ID'); - cy.showColumn('Volume'); - cy.showColumn('Volume Unit'); - cy.showColumn('Laboratory Procedure'); - cy.showColumn('Biospecimen Storage'); - }); - - it('Lien Participant ID du tableau', () => { - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(6).find('[href]').clickAndWait({force: true}); - cy.get('[id="participant-entity-page"]').should('exist'); - cy.get('[class*="EntityTitle"]').contains('pt-as0aepqm'); - }); - - it('Lien Collection ID du tableau', () => { - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(7).find('[type="link"]').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.validatePillSelectedQuery('Collection ID', ['Bs-m623h3mrgg'], 1); - }); - - it('Lien Files du tableau', () => { - cy.get('tr[class*="ant-table-row"] [class*="ant-table-cell"]').eq(17).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Sample ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-03ynynfs').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); + cy.visitDataExploration('biospecimens'); + cy.showColumn('External Sample ID'); + cy.showColumn('Volume'); + cy.showColumn('Volume Unit'); + cy.showColumn('Laboratory Procedure'); + cy.showColumn('Biospecimen Storage'); }); describe('Page Data Exploration (Biospecimens) - Valider les fonctionnalités du tableau', () => { - beforeEach(() => { - cy.visitDataExploration('biospecimens'); - cy.showColumn('External Sample ID'); - cy.showColumn('Volume'); - cy.showColumn('Volume Unit'); - cy.showColumn('Laboratory Procedure'); - cy.showColumn('Biospecimen Storage'); - }); - it('Valider les fonctionnalités du tableau - Tri Sample ID', () => { cy.sortTableAndWait('Sample ID'); cy.validateTableFirstRow(/^(?!-).*$/, 1, true); @@ -199,4 +127,3 @@ describe('Page Data Exploration (Biospecimens) - Valider les fonctionnalités du cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); }); }); - \ No newline at end of file diff --git a/cypress/e2e/Consultation/TableauFiles_1.cy.ts b/cypress/e2e/Consultation/TableauFiles_1.cy.ts new file mode 100644 index 00000000..6cbc418c --- /dev/null +++ b/cypress/e2e/Consultation/TableauFiles_1.cy.ts @@ -0,0 +1,34 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.showColumn('File Name'); + cy.showColumn('Dataset'); + cy.showColumn('Access Url'); +}); + +describe('Page Data Exploration (Data Files) - Vérifier les informations affichées', () => { + it('Titre', () => { + cy.get('[class*="DataExploration_title"]').contains('Data Exploration'); // data-cy="Title_DataExploration" + }); + + it('Tableau', () => { + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(1).find('svg[data-icon="lock"]').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(2).contains('C').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(2).find('[class*="ant-tag-geekblue"]').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(3).contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(4).contains('HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(5).contains('HTP').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(6).contains('HTP Whole Blood RNAseq (2020)').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(7).contains('Transcriptomics').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(8).contains('Unaligned Reads').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(9).contains('RNA-Seq').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(10).contains('drs://data.kidsfirstdrc.org/1cd34bd9-d780-47f4-907e-0f04be67ef68').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(11).contains('fastq').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(12).contains('3.13 GB').should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(13).contains(/\d{1}/).should('exist'); + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(14).contains(/\d{1}/).should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauFiles_2.cy.ts b/cypress/e2e/Consultation/TableauFiles_2.cy.ts new file mode 100644 index 00000000..b44fa36e --- /dev/null +++ b/cypress/e2e/Consultation/TableauFiles_2.cy.ts @@ -0,0 +1,34 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.showColumn('File Name'); + cy.showColumn('Dataset'); + cy.showColumn('Access Url'); +}); + +describe('Page Data Exploration (Data Files) - Valider les liens disponibles', () => { + it('Lien File ID du tableau', () => { + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(3).find('[href]').clickAndWait({force: true}); + cy.get('[id="file-entity-page"]').should('exist'); + cy.get('[class*="EntityTitle"]').contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz'); + }); + + it('Lien Participants du tableau', () => { + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(13).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.HTP0577A FRRB192320222-1a HWHKMDSXX L1 1.fq.gz').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); + + it('Lien Biospecimens du tableau', () => { + cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(14).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.HTP0577A FRRB192320222-1a HWHKMDSXX L1 1.fq.gz').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); +}); diff --git a/cypress/e2e/Consultation/TableauFiles.cy.ts b/cypress/e2e/Consultation/TableauFiles_3.cy.ts similarity index 54% rename from cypress/e2e/Consultation/TableauFiles.cy.ts rename to cypress/e2e/Consultation/TableauFiles_3.cy.ts index fad47d57..2798e5b5 100644 --- a/cypress/e2e/Consultation/TableauFiles.cy.ts +++ b/cypress/e2e/Consultation/TableauFiles_3.cy.ts @@ -3,78 +3,13 @@ import '../../support/commands'; beforeEach(() => { cy.login(); -}); - -describe('Page Data Exploration (Data Files) - Vérifier les informations affichées', () => { - beforeEach(() => { - cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); - cy.showColumn('File Name'); - cy.showColumn('Dataset'); - cy.showColumn('Access Url'); - }); - - it('Titre', () => { - cy.get('[class*="DataExploration_title"]').contains('Data Exploration'); // data-cy="Title_DataExploration" - }); - - it('Tableau', () => { - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(1).find('svg[data-icon="lock"]').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(2).contains('C').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(2).find('[class*="ant-tag-geekblue"]').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(3).contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(4).contains('HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(5).contains('HTP').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(6).contains('HTP Whole Blood RNAseq (2020)').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(7).contains('Transcriptomics').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(8).contains('Unaligned Reads').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(9).contains('RNA-Seq').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(10).contains('drs://data.kidsfirstdrc.org/1cd34bd9-d780-47f4-907e-0f04be67ef68').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(11).contains('fastq').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(12).contains('3.13 GB').should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(13).contains(/\d{1}/).should('exist'); - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(14).contains(/\d{1}/).should('exist'); - }); -}); - -describe('Page Data Exploration (Data Files) - Valider les liens disponibles', () => { - beforeEach(() => { - cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); - cy.showColumn('File Name'); - cy.showColumn('Dataset'); - cy.showColumn('Access Url'); - }); - - it('Lien File ID du tableau', () => { - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(3).find('[href]').clickAndWait({force: true}); - cy.get('[id="file-entity-page"]').should('exist'); - cy.get('[class*="EntityTitle"]').contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz'); - }); - - it('Lien Participants du tableau', () => { - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(13).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.HTP0577A FRRB192320222-1a HWHKMDSXX L1 1.fq.gz').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); - - it('Lien Biospecimens du tableau', () => { - cy.get('tr[data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_1.fq.gz"] [class*="ant-table-cell"]').eq(14).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.HTP0577A FRRB192320222-1a HWHKMDSXX L1 1.fq.gz').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); + cy.visitDataExploration('datafiles'); + cy.showColumn('File Name'); + cy.showColumn('Dataset'); + cy.showColumn('Access Url'); }); describe('Page Data Exploration (Data Files) - Valider les fonctionnalités du tableau', () => { - beforeEach(() => { - cy.visitDataExploration('datafiles'); - cy.showColumn('File Name'); - cy.showColumn('Dataset'); - cy.showColumn('Access Url'); - }); - it('Valider les fonctionnalités du tableau - Tri File ID', () => { cy.sortTableAndWait('File ID',); cy.validateTableFirstRow(/^(?!-).*$/, 3, true); @@ -198,4 +133,3 @@ describe('Page Data Exploration (Data Files) - Valider les fonctionnalités du t cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); }); }); - \ No newline at end of file diff --git a/cypress/e2e/Consultation/TableauParticipants.cy.ts b/cypress/e2e/Consultation/TableauParticipants.cy.ts deleted file mode 100644 index 3f398cff..00000000 --- a/cypress/e2e/Consultation/TableauParticipants.cy.ts +++ /dev/null @@ -1,254 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page Data Exploration (Participants) - Vérifier les informations affichées', () => { - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); - cy.showColumn('Race'); - cy.showColumn('Ethnicity'); - cy.showColumn('Age'); - cy.showColumn('External Participant ID'); - cy.showColumn('Family Unit'); - cy.showColumn('Condition (Source Text)'); - }); - - it('Titre', () => { - cy.get('[class*="DataExploration_title"]').contains('Data Exploration'); // data-cy="Title_DataExploration" - }); - - it('Tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(1).contains('pt-as0aepqm').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(2).contains('HTP').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(3).contains(/(phs002330|phs002981|-)/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(4).contains('T21').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(5).contains('Female').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(5).find('[class*="ant-tag-magenta"]').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(6).contains('White').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(7).contains('Not Hispanic or Latino').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('28').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('years').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('139').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('days').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(9).contains('HTP0577').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(10).contains('Proband-only').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains(/(Hypothyroidism|Atrial septal defect \(ASD\)|Congenital heart defect \(CHD\) - any|Hidradenitis suppurativa|Psoriasis|Complete trisomy 21)/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('See more').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains(/(Hypothyroidism|Atrial septal defect|Congenital heart disease|Hidradenitis suppurativa|Psoriasis|Complete trisomy 21)/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('MONDO:').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains(/(0005420|0006664|0005453|0006559|0005083|0700030)/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('See more').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains(/(Abnormal heart morphology|Acne inversa|Atrial septal defect|Hypothyroidism|Psoriasiform dermatitis)/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('HP:').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains(/(0001627|0040154|0001631|0000821|0003765)/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('See more').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(14).contains(/\d{1}/).should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(15).contains(/\d{1}/).should('exist'); - }); -}); - -describe('Page Data Exploration (Participants) - Valider les liens disponibles', () => { - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); - cy.showColumn('Race'); - cy.showColumn('Ethnicity'); - cy.showColumn('Age'); - cy.showColumn('External Participant ID'); - cy.showColumn('Family Unit'); - cy.showColumn('Condition (Source Text)'); - }); - - it('Lien Participant du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); - cy.get('[id="participant-entity-page"]').should('exist'); - cy.get('[class*="EntityTitle"]').contains('pt-as0aepqm'); - }); - - // Ne fonctionne pas pour une raison inconnue - it.skip('Lien dbGap du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class="ant-table-cell"]').eq(3).invoke('text').then((invokeText) => { - if (!invokeText.includes('-')) { - cy.get('tr[data-row-key="pt-as0aepqm"] [class="ant-table-cell"]').eq(3).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); - }; - }); - }); - - it('Lien \'See more\' de Condition (Source Text) du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('See more').clickAndWait({force: true}); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('Complete trisomy 21').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('See less').clickAndWait({force: true}); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('Complete trisomy 21').should('not.exist'); - }); - - it('Lien Mondo de Diagnosis (MONDO) du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).find('[href]') - .should('have.attr', 'href').and('match', /http:\/\/purl\.obolibrary\.org\/obo\/MONDO_(0005420|0005453|0006664|0006559|0700030|0005083)/); - }); - - it('Lien \'See more\' de Diagnosis (MONDO) du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('See more').clickAndWait({force: true}); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('Complete trisomy 21').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('See less').clickAndWait({force: true}); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('Complete trisomy 21').should('not.exist'); - }); - - it('Lien HP de Phenotype (HPO) du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).find('[href]') - .should(($element) => { - const hrefValue = $element.attr('href'); - const strHrefValue : string = hrefValue !== undefined ? hrefValue : ""; - const regex = /http:\/\/purl\.obolibrary\.org\/obo\/HP_00/; - assert.match(strHrefValue, regex); - }); - }); - - it('Lien \'See more\' de Phenotype (HPO) du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('See more').clickAndWait({force: true}); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('Acne inversa').should('exist'); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('See less').clickAndWait({force: true}); - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('Acne inversa').should('not.exist'); - }); - - it('Lien Biospecimens du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(14).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); - - it('Lien Files du tableau', () => { - cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(15).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - }); -}); - -describe('Page Data Exploration (Participants) - Valider les fonctionnalités du tableau', () => { - beforeEach(() => { - cy.visitDataExploration('participants'); - cy.showColumn('Race'); - cy.showColumn('Ethnicity'); - cy.showColumn('Age'); - cy.showColumn('External Participant ID'); - cy.showColumn('Family Unit'); - cy.showColumn('Condition (Source Text)'); - }); - - it('Valider les fonctionnalités du tableau - Tri Participant ID', () => { - cy.sortTableAndWait('Participant ID'); - cy.validateTableFirstRow(/^(?!-).*$/, 1, true); - cy.sortTableAndIntercept('Participant ID', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 1, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Study', () => { - cy.sortTableAndIntercept('Study', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 2, true); - cy.sortTableAndIntercept('Study', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 2, true); - }); - - it('Valider les fonctionnalités du tableau - Tri DS Status [SJIP-1234]', () => { - cy.sortTableAndIntercept('DS Status', 1); - cy.validateTableFirstRow('D21', 4, true); - cy.sortTableAndIntercept('DS Status', 1); - cy.validateTableFirstRow('T21', 4, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Sex', () => { - cy.sortTableAndIntercept('Sex', 1); - cy.validateTableFirstRow('Female', 5, true); - cy.sortTableAndIntercept('Sex', 1); - cy.validateTableFirstRow('Unknown', 5, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Race [SJIP-1234]', () => { - cy.sortTableAndIntercept('Race', 1); - cy.validateTableFirstRow('American Indian or Alaska Native', 6, true); - cy.sortTableAndIntercept('Race', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 6, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Ethnicity', () => { - cy.sortTableAndIntercept('Ethnicity', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 7, true); - cy.sortTableAndIntercept('Ethnicity', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 7, true); - }); - - it('Valider les fonctionnalités du tableau - Tri External Participant ID', () => { - cy.sortTableAndIntercept('External Participant ID', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 9, true); - cy.sortTableAndIntercept('External Participant ID', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 9, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Family Unit [SJIP-1234]', () => { - cy.sortTableAndIntercept('Family Unit', 1); - cy.validateTableFirstRow('-', 10, true); - cy.sortTableAndIntercept('Family Unit', 1); - cy.validateTableFirstRow('Trio+', 10, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Biospecimens [SJIP-1234]', () => { - cy.sortTableAndIntercept('Biospecimens', 1); - cy.validateTableFirstRow(/\d{1}/, 14, true); - cy.sortTableAndIntercept('Biospecimens', 1); - cy.validateTableFirstRow(/\d{1}/, 14, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Files', () => { - cy.sortTableAndWait('Files'); - cy.validateTableFirstRow(/\d{1}/, 15, true); - cy.sortTableAndWait('Files'); - cy.validateTableFirstRow(/\d{1}/, 15, true); - }); - - it('Valider les fonctionnalités du tableau - Tri multiple', () => { - cy.sortTableAndIntercept('Sex', 1); - cy.sortTableAndWait('Participant ID'); - cy.sortTableAndIntercept('Participant ID', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 1, true); - }); - - it('Valider les fonctionnalités du tableau - Pagination', () => { - cy.get('span[class*="ant-select-selection-item"]').clickAndWait({force: true}); - cy.get('div[class*="ant-select-item-option-content"]').contains('20').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); - - cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); - - cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^41$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^60$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); - - cy.get('button[type="button"]').contains('Prev.').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); - - cy.get('button[type="button"]').contains('First').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); - }); -}); - \ No newline at end of file diff --git a/cypress/e2e/Consultation/TableauParticipants_1.cy.ts b/cypress/e2e/Consultation/TableauParticipants_1.cy.ts new file mode 100644 index 00000000..17edb3e8 --- /dev/null +++ b/cypress/e2e/Consultation/TableauParticipants_1.cy.ts @@ -0,0 +1,48 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.showColumn('Race'); + cy.showColumn('Ethnicity'); + cy.showColumn('Age'); + cy.showColumn('External Participant ID'); + cy.showColumn('Family Unit'); + cy.showColumn('Condition (Source Text)'); +}); + +describe('Page Data Exploration (Participants) - Vérifier les informations affichées', () => { + it('Titre', () => { + cy.get('[class*="DataExploration_title"]').contains('Data Exploration'); // data-cy="Title_DataExploration" + }); + + it('Tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(1).contains('pt-as0aepqm').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(2).contains('HTP').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(3).contains(/(phs002330|phs002981|-)/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(4).contains('T21').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(5).contains('Female').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(5).find('[class*="ant-tag-magenta"]').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(6).contains('White').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(7).contains('Not Hispanic or Latino').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('28').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('years').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('139').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(8).contains('days').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(9).contains('HTP0577').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(10).contains('Proband-only').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains(/(Hypothyroidism|Atrial septal defect \(ASD\)|Congenital heart defect \(CHD\) - any|Hidradenitis suppurativa|Psoriasis|Complete trisomy 21)/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('See more').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains(/(Hypothyroidism|Atrial septal defect|Congenital heart disease|Hidradenitis suppurativa|Psoriasis|Complete trisomy 21)/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('MONDO:').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains(/(0005420|0006664|0005453|0006559|0005083|0700030)/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('See more').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains(/(Abnormal heart morphology|Acne inversa|Atrial septal defect|Hypothyroidism|Psoriasiform dermatitis)/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('HP:').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains(/(0001627|0040154|0001631|0000821|0003765)/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('See more').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(14).contains(/\d{1}/).should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(15).contains(/\d{1}/).should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauParticipants_2.cy.ts b/cypress/e2e/Consultation/TableauParticipants_2.cy.ts new file mode 100644 index 00000000..56e4aad4 --- /dev/null +++ b/cypress/e2e/Consultation/TableauParticipants_2.cy.ts @@ -0,0 +1,78 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.showColumn('Race'); + cy.showColumn('Ethnicity'); + cy.showColumn('Age'); + cy.showColumn('External Participant ID'); + cy.showColumn('Family Unit'); + cy.showColumn('Condition (Source Text)'); +}); + +describe('Page Data Exploration (Participants) - Valider les liens disponibles', () => { + it('Lien Participant du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); + cy.get('[id="participant-entity-page"]').should('exist'); + cy.get('[class*="EntityTitle"]').contains('pt-as0aepqm'); + }); + + it('Lien dbGap du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(3).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); + }); + + it('Lien \'See more\' de Condition (Source Text) du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('See more').clickAndWait({force: true}); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('Complete trisomy 21').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('See less').clickAndWait({force: true}); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(11).contains('Complete trisomy 21').should('not.exist'); + }); + + it('Lien Mondo de Diagnosis (MONDO) du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).find('[href]') + .should('have.attr', 'href').and('match', /http:\/\/purl\.obolibrary\.org\/obo\/MONDO_(0005420|0005453|0006664|0006559|0700030|0005083)/); + }); + + it('Lien \'See more\' de Diagnosis (MONDO) du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('See more').clickAndWait({force: true}); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('Complete trisomy 21').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('See less').clickAndWait({force: true}); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(12).contains('Complete trisomy 21').should('not.exist'); + }); + + it('Lien HP de Phenotype (HPO) du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).find('[href]') + .should(($element) => { + const hrefValue = $element.attr('href'); + const strHrefValue : string = hrefValue !== undefined ? hrefValue : ""; + const regex = /http:\/\/purl\.obolibrary\.org\/obo\/HP_00/; + assert.match(strHrefValue, regex); + }); + }); + + it('Lien \'See more\' de Phenotype (HPO) du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('See more').clickAndWait({force: true}); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('Acne inversa').should('exist'); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('See less').clickAndWait({force: true}); + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(13).contains('Acne inversa').should('not.exist'); + }); + + it('Lien Biospecimens du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(14).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); + + it('Lien Files du tableau', () => { + cy.get('tr[data-row-key="pt-as0aepqm"] [class*="ant-table-cell"]').eq(15).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + }); +}); diff --git a/cypress/e2e/Consultation/TableauParticipants_3.cy.ts b/cypress/e2e/Consultation/TableauParticipants_3.cy.ts new file mode 100644 index 00000000..06b8c478 --- /dev/null +++ b/cypress/e2e/Consultation/TableauParticipants_3.cy.ts @@ -0,0 +1,125 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.showColumn('Race'); + cy.showColumn('Ethnicity'); + cy.showColumn('Age'); + cy.showColumn('External Participant ID'); + cy.showColumn('Family Unit'); + cy.showColumn('Condition (Source Text)'); +}); + +describe('Page Data Exploration (Participants) - Valider les fonctionnalités du tableau', () => { + it('Valider les fonctionnalités du tableau - Tri Participant ID', () => { + cy.sortTableAndWait('Participant ID'); + cy.validateTableFirstRow(/^(?!-).*$/, 1, true); + cy.sortTableAndIntercept('Participant ID', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 1, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Study', () => { + cy.sortTableAndIntercept('Study', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 2, true); + cy.sortTableAndIntercept('Study', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 2, true); + }); + + it('Valider les fonctionnalités du tableau - Tri DS Status [SJIP-1234]', () => { + cy.sortTableAndIntercept('DS Status', 1); + cy.validateTableFirstRow('D21', 4, true); + cy.sortTableAndIntercept('DS Status', 1); + cy.validateTableFirstRow('T21', 4, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Sex', () => { + cy.sortTableAndIntercept('Sex', 1); + cy.validateTableFirstRow('Female', 5, true); + cy.sortTableAndIntercept('Sex', 1); + cy.validateTableFirstRow('Unknown', 5, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Race [SJIP-1234]', () => { + cy.sortTableAndIntercept('Race', 1); + cy.validateTableFirstRow('American Indian or Alaska Native', 6, true); + cy.sortTableAndIntercept('Race', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 6, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Ethnicity', () => { + cy.sortTableAndIntercept('Ethnicity', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 7, true); + cy.sortTableAndIntercept('Ethnicity', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 7, true); + }); + + it('Valider les fonctionnalités du tableau - Tri External Participant ID', () => { + cy.sortTableAndIntercept('External Participant ID', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 9, true); + cy.sortTableAndIntercept('External Participant ID', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 9, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Family Unit [SJIP-1234]', () => { + cy.sortTableAndIntercept('Family Unit', 1); + cy.validateTableFirstRow('-', 10, true); + cy.sortTableAndIntercept('Family Unit', 1); + cy.validateTableFirstRow('Trio+', 10, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Biospecimens [SJIP-1234]', () => { + cy.sortTableAndIntercept('Biospecimens', 1); + cy.validateTableFirstRow(/\d{1}/, 14, true); + cy.sortTableAndIntercept('Biospecimens', 1); + cy.validateTableFirstRow(/\d{1}/, 14, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Files', () => { + cy.sortTableAndWait('Files'); + cy.validateTableFirstRow(/\d{1}/, 15, true); + cy.sortTableAndWait('Files'); + cy.validateTableFirstRow(/\d{1}/, 15, true); + }); + + it('Valider les fonctionnalités du tableau - Tri multiple', () => { + cy.sortTableAndIntercept('Sex', 1); + cy.sortTableAndWait('Participant ID'); + cy.sortTableAndIntercept('Participant ID', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 1, true); + }); + + it('Valider les fonctionnalités du tableau - Pagination', () => { + cy.get('span[class*="ant-select-selection-item"]').clickAndWait({force: true}); + cy.get('div[class*="ant-select-item-option-content"]').contains('20').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); + + cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); + + cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^41$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^60$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); + + cy.get('button[type="button"]').contains('Prev.').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); + + cy.get('button[type="button"]').contains('First').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauStudies.cy.ts b/cypress/e2e/Consultation/TableauStudies.cy.ts deleted file mode 100644 index 813cbc9d..00000000 --- a/cypress/e2e/Consultation/TableauStudies.cy.ts +++ /dev/null @@ -1,154 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); - cy.visitStudiesPage(); - cy.showColumn('Description'); - cy.showColumn('Participant Lifespan'); - cy.showColumn('Data Source'); - cy.showColumn('Design'); - cy.showColumn('Principal Investigator'); - cy.showColumn('Start'); - cy.showColumn('End'); -}); - -describe('Page des études - Vérifier les informations affichées', () => { - it('Titre', () => { - cy.get('[class*="PageContent_title"]').contains('Studies'); // data-cy="Title_Studies" - }); - - it('Tableau [SJIP-1207]', () => { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(0).find('[class*="ant-tag-green"]').contains('H').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(1).contains('HTP').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(2).contains('The Human Trisome Project').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(3).contains('INCLUDE').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(4).contains('All Co-occurring Conditions').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(5).contains(/(phs002330|phs002981|-)/).should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(6).contains(/\d{1}/).should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(7).contains(/\d{1}/).should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(8).contains(/\d{1}/).should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(9).contains(/\d{1}/).should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(10).find('[data-icon="check"]').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(11).find('[data-icon="check"]').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(12).find('[data-icon="check"]').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(13).contains('-').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(14).find('[data-icon="check"]').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(15).contains('The Human Trisome Project (').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(16).contains('Pediatric').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(16).contains('Adult').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(17).contains('Investigator Assessment').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(17).contains('Medical Record').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(18).contains('longitudinal').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(19).contains('Joaquin M. Espinosa').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(20).contains('2016').should('exist'); - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(21).contains('-').should('exist'); - }); -}); - -describe('Page des études - Valider les liens disponibles', () => { - it('Lien Code du tableau', () => { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); - cy.get('[class*="EntityTitle"]').contains('The Human Trisome Project').should('exist'); - }); - - it('Lien dbGap du tableau', () => { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(5).invoke('text').then((invokeText) => { - if (!invokeText.includes('-')) { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(5).find('[href]') - .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); - }; - }); - }); - - it('Lien Participants du tableau', () => { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(6).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Lien Biospecimens du tableau', () => { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(8).find('[href]').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Lien Files du tableau', () => { - cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(9).find('[href]').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); - }); - - it('Lien \'See more\' de Data Source du tableau', () => { - cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See more').clickAndWait({force: true}); - cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).contains('Participant or Caregiver Report').should('exist'); - cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See less').clickAndWait({force: true}); - cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).contains('Participant or Caregiver Report').should('not.exist'); - }); -}); - - -describe('Page des études - Consultation du tableau', () => { - beforeEach(() => { - cy.clickAndIntercept('input[type="radio"][value="true"]', 'POST', '**/graphql', 15, false/*beVisible*/, 1); - }); - - it('Valider les fonctionnalités du tableau - Tri Code', () => { - cy.sortTableAndWait('Code'); - cy.validateTableFirstRow('ABC-DS', 1); - cy.sortTableAndIntercept('Code', 1); - cy.validateTableFirstRow('X01-deSmith', 1); - }); - - it('Valider les fonctionnalités du tableau - Tri Name', () => { - cy.sortTableAndIntercept('Name', 1); - cy.validateTableFirstRow(/^A/, 2); - cy.sortTableAndIntercept('Name', 1); - cy.validateTableFirstRow(/^(?!A)/, 2); - }); - - it('Valider les fonctionnalités du tableau - Tri dbGaP', () => { - cy.sortTableAndIntercept('dbGaP', 1); - cy.validateTableFirstRow('-', 5); - cy.sortTableAndIntercept('dbGaP', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 5); - }); - - it('Valider les fonctionnalités du tableau - Tri Participants', () => { - cy.sortTableAndIntercept('Participants', 1); - cy.validateTableFirstRow(/\d{1}/, 6); - cy.sortTableAndIntercept('Participants', 1); - cy.validateTableFirstRow(/\d{1}/, 6); - }); - - it('Valider les fonctionnalités du tableau - Tri Families', () => { - cy.sortTableAndIntercept('Families', 1); - cy.validateTableFirstRow('-', 7); - cy.sortTableAndIntercept('Families', 1); - cy.validateTableFirstRow(/\d{1}/, 7); - }); - - it('Valider les fonctionnalités du tableau - Tri Biospecimens', () => { - cy.sortTableAndIntercept('Biospecimen', 1); - cy.validateTableFirstRow('-', 8); - cy.sortTableAndIntercept('Biospecimen', 1); - cy.validateTableFirstRow(/\d{1}/, 8); - }); - - it('Valider les fonctionnalités du tableau - Tri Files', () => { - cy.sortTableAndIntercept('Files', 1); - cy.validateTableFirstRow('-', 9); - cy.sortTableAndIntercept('Files', 1); - cy.validateTableFirstRow(/\d{1}/, 9); - }); - - it('Valider les fonctionnalités du tableau - Tri multiple', () => { - cy.sortTableAndIntercept('Families', 1); - cy.sortTableAndIntercept('Biospecimen', 1); - cy.sortTableAndIntercept('Biospecimen', 1); - cy.validateTableFirstRow(/^(?!-).*$/, 1); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/Consultation/TableauStudies_1.cy.ts b/cypress/e2e/Consultation/TableauStudies_1.cy.ts new file mode 100644 index 00000000..06625c60 --- /dev/null +++ b/cypress/e2e/Consultation/TableauStudies_1.cy.ts @@ -0,0 +1,47 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitStudiesPage(); + cy.showColumn('Description'); + cy.showColumn('Participant Lifespan'); + cy.showColumn('Data Source'); + cy.showColumn('Design'); + cy.showColumn('Principal Investigator'); + cy.showColumn('Start'); + cy.showColumn('End'); +}); + +describe('Page des études - Vérifier les informations affichées', () => { + it('Titre', () => { + cy.get('[class*="PageContent_title"]').contains('Studies'); // data-cy="Title_Studies" + }); + + it('Tableau [SJIP-1207]', () => { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(0).find('[class*="ant-tag-green"]').contains('H').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(1).contains('HTP').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(2).contains('The Human Trisome Project').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(3).contains('INCLUDE').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(4).contains('All Co-occurring Conditions').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(5).contains(/(phs002330|phs002981|-)/).should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(6).contains(/\d{1}/).should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(7).contains(/\d{1}/).should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(8).contains(/\d{1}/).should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(9).contains(/\d{1}/).should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(10).find('[data-icon="check"]').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(11).find('[data-icon="check"]').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(12).find('[data-icon="check"]').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(13).contains('-').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(14).find('[data-icon="check"]').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(15).contains('The Human Trisome Project (').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(16).contains('Pediatric').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(16).contains('Adult').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(17).contains('Investigator Assessment').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(17).contains('Medical Record').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(18).contains('longitudinal').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(19).contains('Joaquin M. Espinosa').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(20).contains('2016').should('exist'); + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(21).contains('-').should('exist'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauStudies_2.cy.ts b/cypress/e2e/Consultation/TableauStudies_2.cy.ts new file mode 100644 index 00000000..24c13b73 --- /dev/null +++ b/cypress/e2e/Consultation/TableauStudies_2.cy.ts @@ -0,0 +1,58 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitStudiesPage(); + cy.showColumn('Description'); + cy.showColumn('Participant Lifespan'); + cy.showColumn('Data Source'); + cy.showColumn('Design'); + cy.showColumn('Principal Investigator'); + cy.showColumn('Start'); + cy.showColumn('End'); +}); + +describe('Page des études - Valider les liens disponibles', () => { + it('Lien Code du tableau', () => { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(1).find('[href]').clickAndWait({force: true}); + cy.get('[class*="EntityTitle"]').contains('The Human Trisome Project').should('exist'); + }); + + it('Lien dbGap du tableau', () => { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(5).invoke('text').then((invokeText) => { + if (!invokeText.includes('-')) { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(5).find('[href]') + .should('have.attr', 'href').and('match', /https:\/\/www\.ncbi\.nlm\.nih\.gov\/projects\/gap\/cgi-bin\/study\.cgi\?study_id\=(phs002330|phs002981)/); + }; + }); + }); + + it('Lien Participants du tableau', () => { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(6).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Participants_participantTabWrapper"]').should('exist'); // data-cy="ProTable_Participants" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Lien Biospecimens du tableau', () => { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(8).find('[href]').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); // data-cy="ProTable_Biospecimens" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Lien Files du tableau', () => { + cy.get('tr[data-row-key="HTP"] [class="ant-table-cell"]').eq(9).find('[href]').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_DataFiles" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Study Code').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP').should('exist'); + }); + + it('Lien \'See more\' de Data Source du tableau', () => { + cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See more').clickAndWait({force: true}); + cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).contains('Participant or Caregiver Report').should('exist'); + cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).find('[class*="ExpandableCell_fuiExpandableCellBtn"]').contains('See less').clickAndWait({force: true}); + cy.get('tr[data-row-key="HTP"] [class*="ant-table-cell"]').eq(17).contains('Participant or Caregiver Report').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Consultation/TableauStudies_3.cy.ts b/cypress/e2e/Consultation/TableauStudies_3.cy.ts new file mode 100644 index 00000000..f36bf489 --- /dev/null +++ b/cypress/e2e/Consultation/TableauStudies_3.cy.ts @@ -0,0 +1,73 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitStudiesPage(); + cy.showColumn('Description'); + cy.showColumn('Participant Lifespan'); + cy.showColumn('Data Source'); + cy.showColumn('Design'); + cy.showColumn('Principal Investigator'); + cy.showColumn('Start'); + cy.showColumn('End'); + cy.clickAndIntercept('input[type="radio"][value="true"]', 'POST', '**/graphql', 15, false/*beVisible*/, 1); +}); + +describe('Page des études - Consultation du tableau', () => { + it('Valider les fonctionnalités du tableau - Tri Code', () => { + cy.sortTableAndWait('Code'); + cy.validateTableFirstRow('ABC-DS', 1); + cy.sortTableAndIntercept('Code', 1); + cy.validateTableFirstRow('X01-deSmith', 1); + }); + + it('Valider les fonctionnalités du tableau - Tri Name', () => { + cy.sortTableAndIntercept('Name', 1); + cy.validateTableFirstRow(/^A/, 2); + cy.sortTableAndIntercept('Name', 1); + cy.validateTableFirstRow(/^(?!A)/, 2); + }); + + it('Valider les fonctionnalités du tableau - Tri dbGaP', () => { + cy.sortTableAndIntercept('dbGaP', 1); + cy.validateTableFirstRow('-', 5); + cy.sortTableAndIntercept('dbGaP', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 5); + }); + + it('Valider les fonctionnalités du tableau - Tri Participants', () => { + cy.sortTableAndIntercept('Participants', 1); + cy.validateTableFirstRow(/\d{1}/, 6); + cy.sortTableAndIntercept('Participants', 1); + cy.validateTableFirstRow(/\d{1}/, 6); + }); + + it('Valider les fonctionnalités du tableau - Tri Families', () => { + cy.sortTableAndIntercept('Families', 1); + cy.validateTableFirstRow('-', 7); + cy.sortTableAndIntercept('Families', 1); + cy.validateTableFirstRow(/\d{1}/, 7); + }); + + it('Valider les fonctionnalités du tableau - Tri Biospecimens', () => { + cy.sortTableAndIntercept('Biospecimen', 1); + cy.validateTableFirstRow('-', 8); + cy.sortTableAndIntercept('Biospecimen', 1); + cy.validateTableFirstRow(/\d{1}/, 8); + }); + + it('Valider les fonctionnalités du tableau - Tri Files', () => { + cy.sortTableAndIntercept('Files', 1); + cy.validateTableFirstRow('-', 9); + cy.sortTableAndIntercept('Files', 1); + cy.validateTableFirstRow(/\d{1}/, 9); + }); + + it('Valider les fonctionnalités du tableau - Tri multiple', () => { + cy.sortTableAndIntercept('Families', 1); + cy.sortTableAndIntercept('Biospecimen', 1); + cy.sortTableAndIntercept('Biospecimen', 1); + cy.validateTableFirstRow(/^(?!-).*$/, 1); + }); +}); diff --git a/cypress/e2e/Consultation/TableauVariants.cy.ts b/cypress/e2e/Consultation/TableauVariants_1.cy.ts similarity index 53% rename from cypress/e2e/Consultation/TableauVariants.cy.ts rename to cypress/e2e/Consultation/TableauVariants_1.cy.ts index 669fa6e5..c60a502e 100644 --- a/cypress/e2e/Consultation/TableauVariants.cy.ts +++ b/cypress/e2e/Consultation/TableauVariants_1.cy.ts @@ -3,17 +3,14 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitVariantsPage('?sharedFilterId=821e14bc-acf4-4566-a89f-5456ffef2032'); + cy.showColumn('CADD'); + cy.showColumn('REVEL'); + cy.showColumn(/^ALT$/); + cy.showColumn('Homo.'); }); describe('Page des variants - Consultation du tableau', () => { - beforeEach(() => { - cy.visitVariantsPage('?sharedFilterId=821e14bc-acf4-4566-a89f-5456ffef2032'); - cy.showColumn('CADD'); - cy.showColumn('REVEL'); - cy.showColumn(/^ALT$/); - cy.showColumn('Homo.'); - }); - it('Vérifier les informations affichées', () => { cy.get('tr[data-row-key]').eq(0).find('[class*="ant-table-cell"]').eq(1).contains('chr1:g.108192590T>C').should('exist'); cy.get('tr[data-row-key]').eq(0).find('[class*="ant-table-cell"]').eq(2).contains('SNV').should('exist'); @@ -92,104 +89,3 @@ describe('Page des variants - Consultation du tableau', () => { cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('DS-COG-ALL').should('exist'); }); }); - -describe('Page des variants - Consultation du tableau', () => { - beforeEach(() => { - cy.visitVariantsPage(); - cy.showColumn('CADD'); - cy.showColumn('REVEL'); - cy.showColumn(/^ALT$/); - cy.showColumn('Homo.'); - }); - - it('Valider les fonctionnalités du tableau - Tri Variant', () => { - cy.sortTableAndIntercept('Variant', 1); - cy.validateTableFirstRow('-', 1, true); - cy.sortTableAndIntercept('Variant', 1); - cy.validateTableFirstRow('chr1:g.99999822dup', 1, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Type', () => { - cy.sortTableAndIntercept('Type', 1); - cy.validateTableFirstRow('-', 2, true); - cy.sortTableAndIntercept('Type', 1); - cy.validateTableFirstRow('SeqAlt', 2, true); - }); - - it('Valider les fonctionnalités du tableau - Tri gnomAD', () => { - cy.sortTableAndIntercept(/^gnomAD$/, 1); - cy.validateTableFirstRow('-', 9, true); - cy.sortTableAndIntercept(/^gnomAD$/, 1); - cy.validateTableFirstRow('1.00e+0', 9, true); - }); - - it('Valider les fonctionnalités du tableau - Tri gnomAD ALT', () => { - cy.sortTableAndIntercept('gnomAD ALT', 1); - cy.validateTableFirstRow('-', 10, true); - cy.sortTableAndIntercept('gnomAD ALT', 1); - cy.validateTableFirstRow('152,276', 10, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Part.', () => { - cy.sortTableAndIntercept('Part.', 1); - cy.validateTableFirstRow(/^1/, 11, true); - cy.sortTableAndIntercept('Part.', 1); - cy.validateTableFirstRow('955', 11, true); - }); - - it('Valider les fonctionnalités du tableau - Tri ALT', () => { - cy.sortTableAndIntercept(/^ALT$/, 1); - cy.validateTableFirstRow(/^1$/, 15, true); - cy.sortTableAndIntercept(/^ALT$/, 1); - cy.validateTableFirstRow('1,910', 15, true); - }); - - it('Valider les fonctionnalités du tableau - Tri Homo.', () => { - cy.sortTableAndIntercept('Homo.', 1); - cy.validateTableFirstRow(/^0$/, 16, true); - cy.sortTableAndIntercept('Homo.', 1); - cy.validateTableFirstRow('955', 16, true); - }); - - it('Valider les fonctionnalités du tableau - Tri multiple', () => { - cy.sortTableAndIntercept('Type', 1); - cy.sortTableAndIntercept('Type', 1); - cy.sortTableAndIntercept('Variant', 1); - cy.sortTableAndIntercept('Variant', 1); - cy.validateTableFirstRow('chr1:g.99848070T>A', 1, true); - }); - - it('Valider les fonctionnalités du tableau - Pagination', () => { - cy.get('span[class*="ant-select-selection-item"]').clickAndWait({force: true}); - cy.get('div[class*="ant-select-item-option-content"]').contains('20').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); - - cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); - - cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^41$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^60$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); - - cy.get('button[type="button"]').contains('Prev.').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); - - cy.get('button[type="button"]').contains('First').clickAndWait({force: true}); - cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); - cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); - cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); - cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); - }); -}); - \ No newline at end of file diff --git a/cypress/e2e/Consultation/TableauVariants_2.cy.ts b/cypress/e2e/Consultation/TableauVariants_2.cy.ts new file mode 100644 index 00000000..73224cf3 --- /dev/null +++ b/cypress/e2e/Consultation/TableauVariants_2.cy.ts @@ -0,0 +1,103 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.showColumn('CADD'); + cy.showColumn('REVEL'); + cy.showColumn(/^ALT$/); + cy.showColumn('Homo.'); +}); + +describe('Page des variants - Consultation du tableau', () => { + it('Valider les fonctionnalités du tableau - Tri Variant', () => { + cy.sortTableAndIntercept('Variant', 1); + cy.validateTableFirstRow('-', 1, true); + cy.sortTableAndIntercept('Variant', 1); + cy.validateTableFirstRow('chr1:g.99999822dup', 1, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Type', () => { + cy.sortTableAndIntercept('Type', 1); + cy.validateTableFirstRow('-', 2, true); + cy.sortTableAndIntercept('Type', 1); + cy.validateTableFirstRow('SeqAlt', 2, true); + }); + + it('Valider les fonctionnalités du tableau - Tri gnomAD', () => { + cy.sortTableAndIntercept(/^gnomAD$/, 1); + cy.validateTableFirstRow('-', 9, true); + cy.sortTableAndIntercept(/^gnomAD$/, 1); + cy.validateTableFirstRow('1.00e+0', 9, true); + }); + + it('Valider les fonctionnalités du tableau - Tri gnomAD ALT', () => { + cy.sortTableAndIntercept('gnomAD ALT', 1); + cy.validateTableFirstRow('-', 10, true); + cy.sortTableAndIntercept('gnomAD ALT', 1); + cy.validateTableFirstRow('152,276', 10, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Part.', () => { + cy.sortTableAndIntercept('Part.', 1); + cy.validateTableFirstRow(/^1/, 11, true); + cy.sortTableAndIntercept('Part.', 1); + cy.validateTableFirstRow('955', 11, true); + }); + + it('Valider les fonctionnalités du tableau - Tri ALT', () => { + cy.sortTableAndIntercept(/^ALT$/, 1); + cy.validateTableFirstRow(/^1$/, 15, true); + cy.sortTableAndIntercept(/^ALT$/, 1); + cy.validateTableFirstRow('1,910', 15, true); + }); + + it('Valider les fonctionnalités du tableau - Tri Homo.', () => { + cy.sortTableAndIntercept('Homo.', 1); + cy.validateTableFirstRow(/^0$/, 16, true); + cy.sortTableAndIntercept('Homo.', 1); + cy.validateTableFirstRow('955', 16, true); + }); + + it('Valider les fonctionnalités du tableau - Tri multiple', () => { + cy.sortTableAndIntercept('Type', 1); + cy.sortTableAndIntercept('Type', 1); + cy.sortTableAndIntercept('Variant', 1); + cy.sortTableAndIntercept('Variant', 1); + cy.validateTableFirstRow('chr1:g.99848070T>A', 1, true); + }); + + it('Valider les fonctionnalités du tableau - Pagination', () => { + cy.get('span[class*="ant-select-selection-item"]').clickAndWait({force: true}); + cy.get('div[class*="ant-select-item-option-content"]').contains('20').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); + + cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); + + cy.get('button[type="button"]').contains('Next').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^41$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^60$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); + + cy.get('button[type="button"]').contains('Prev.').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^21$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^40$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('not.be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('not.be.disabled'); + + cy.get('button[type="button"]').contains('First').clickAndWait({force: true}); + cy.get('div[class*="ProTableHeader"]').contains(/^1$/).should('exist'); + cy.get('div[class*="ProTableHeader"]').contains(/^20$/).should('exist'); + cy.get('button[type="button"]').contains('Prev.').parent('button').should('be.disabled'); + cy.get('button[type="button"]').contains('First').parent('button').should('be.disabled'); + }); +}); diff --git a/cypress/e2e/Facettes/PageDataExploration.cy.ts b/cypress/e2e/Facettes/PageDataExploration.cy.ts deleted file mode 100644 index d952e7b2..00000000 --- a/cypress/e2e/Facettes/PageDataExploration.cy.ts +++ /dev/null @@ -1,319 +0,0 @@ -/// -import '../../support/commands'; -import { oneMinute } from '../../support/utils'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page Data Exploration (Participants) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitDataExploration('participants'); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').its('length').should('eq', 2); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('Search by Participant ID - pt-as0aepqm', () => { - cy.get('[class*="SearchLabel_title"]').contains('Search by Participant ID').should('exist'); //data-cy="SearchLabel_Title" - - cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" - cy.get('div[class="ant-tooltip-inner"]').contains('Search by Participant ID or External Participant ID').should('exist'); - - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'PT-AS0AEPQM', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('pt-as0aepqm').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('pt-as0aepqm').should('exist'); //data-cy="Tag_pt-as0aepqm" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_pt-as0aepqm" - }); - - it('Search by external Participant ID - HTP0577', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'htp0577', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('pt-as0aepqm').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('pt-as0aepqm').should('exist'); //data-cy="Tag_pt-as0aepqm" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_pt-as0aepqm" - }); - - it('Study Code - DS360-CHD', () => { - cy.validateFacetFilter('Study Code', 'DS360-CHD', 'DS360-CHD', /\d{1}/); - cy.validateFacetRank(0, 'Study Code'); - }); - - it('Down Syndrome Status - T21 [SJIP-553]', () => { - cy.validateFacetFilter('Down Syndrome Status', 'T21', 'T21', /\d{1}/); - cy.validateFacetRank(1, 'Down Syndrome Status'); - }); - - it('Diagnosis (MONDO)', () => { - cy.get('div[class*="CollapsePlaceHolderFacet_collapseLikeFacet"]').eq(0).contains('Diagnosis (MONDO)').should('exist'); - // TODO Filtrer - }); - - it('Phenotype (HPO)', () => { - cy.get('div[class*="CollapsePlaceHolderFacet_collapseLikeFacet"]').eq(1).contains('Phenotype (HPO)').should('exist'); - // TODO Filtrer - }); - - it('Condition (Source Text) - Complete trisomy 21', () => { - cy.validateFacetFilter('Condition (Source Text)', 'Complete trisomy 21', 'Complete trisomy 21', /\d{1}/); - cy.validateFacetRank(2, 'Condition (Source Text)'); - }); - - it('Age at Diagnosis (days)', () => { - cy.validateFacetNumFilter('Max', 'Age at Diagnosis (days)', '10000', /\d{1}/); - cy.validateFacetRank(3, 'Age at Diagnosis (days)'); - }); - - it('Age at Vital Status (days)', () => { - cy.validateFacetNumFilter('Max', 'Age at Vital Status (days)', '10000', /\d{1}/); - cy.validateFacetRank(4, 'Age at Vital Status (days)'); - }); - - it('Age at Observed Phenotype (days)', () => { - cy.validateFacetNumFilter('Max', 'Age at Observed Phenotype (days)', '10000', /\d{1}/); - cy.validateFacetRank(5, 'Age at Observed Phenotype (days)'); - }); - - it('Age at First Patient Engagement (days)', () => { - cy.validateFacetNumFilter('Max', 'Age at First Patient Engagement (days)', '10000', /\d{1}/); - cy.validateFacetRank(6, 'Age at First Patient Engagement (days)'); - }); - - it('Family Unit - Proband-only', () => { - cy.validateFacetFilter('Family Unit', 'Proband-only', 'proband-only', /\d{1}/); - cy.validateFacetRank(7, 'Family Unit'); - }); - - it('Sex - Female', () => { - cy.validateFacetFilter('Sex', 'Female', 'female', /\d{1}/); - cy.validateFacetRank(8, 'Sex'); - }); - - it('Race - White', () => { - cy.validateFacetFilter('Race', 'White', 'White', /\d{1}/); - cy.validateFacetRank(9, 'Race'); - }); - - it('Ethnicity - Not Hispanic or Latino', () => { - cy.validateFacetFilter('Ethnicity', 'Not Hispanic or Latino', 'Not Hispanic or Latino', /\d{1}/); - cy.validateFacetRank(10, 'Ethnicity'); - }); - - it('Vital Status - Alive', () => { - cy.validateFacetFilter('Vital Status', 'Alive', 'Alive', /\d{1}/); - cy.validateFacetRank(11, 'Vital Status'); - }); -}); - -describe('Page Data Exploration (Biospecimens) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitDataExploration('biospecimens'); - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('Search by Sample ID - bs-03ynynfs', () => { - cy.get('[class*="SearchLabel_title"]').contains('Search by Sample ID').should('exist'); //data-cy="SearchLabel_Title" - - cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" - cy.get('div[class="ant-tooltip-inner"]').contains('Search by Sample ID or External Sample ID').should('exist'); - - cy.intercept('POST', '*/grapgql').as('getRouteMatcher'); - cy.get('[class*="SearchAutocomplete_search"]').eq(0).find('input').type('BS-03YNYNFS', {force: true}); //data-cy="SearchAutocomplete_Select" - cy.waitWhileSpin(oneMinute); - cy.wait('@getRouteMatcher'); - cy.wait('@getRouteMatcher'); - cy.wait('@getRouteMatcher'); - cy.wait(2000); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('bs-03ynynfs').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('bs-03ynynfs').should('exist'); //data-cy="Tag_bs-03ynynfs" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Sample ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-03ynynfs').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_bs-03ynynfs" - }); - - it('Search by external Sample ID - HTP0577A_PAXgeneWholeBloodRNA', () => { - cy.intercept('POST', '*/grapgql').as('getRouteMatcher'); - cy.get('[class*="SearchAutocomplete_search"]').eq(0).find('input').type('htp0577a_paxgenewholebloodrna', {force: true}); //data-cy="SearchAutocomplete_Select" - cy.waitWhileSpin(oneMinute); - cy.wait('@getRouteMatcher'); - cy.wait('@getRouteMatcher'); - cy.wait('@getRouteMatcher'); - cy.wait(2000); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('bs-03ynynfs').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_bs-03ynynfs" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Sample ID').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_bs-03ynynfs" - }); - - it('Search by Collection ID - bs-m623h3mrgg', () => { - cy.get('[class*="SearchLabel_title"]').contains('Search by Collection ID').should('exist'); //data-cy="SearchLabel_Title" - - cy.intercept('POST', '*/grapgql').as('getRouteMatcher'); - cy.get('[class*="SearchAutocomplete_search"]').eq(1).find('input').type('BS-M623H3MRGG', {force: true}); //data-cy="SearchAutocomplete_Select" - cy.waitWhileSpin(oneMinute); - cy.wait('@getRouteMatcher'); - cy.wait('@getRouteMatcher'); - cy.wait('@getRouteMatcher'); - cy.wait(2000); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('bs-m623h3mrgg').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('bs-m623h3mrgg').should('exist'); //data-cy="Tag_bs-m623h3mrgg" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Collection ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-m623h3mrgg').should('exist'); - cy.validateTableResultsCount(/\d{1}/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_bs-m623h3mrgg" - }); - - it('Sample Type - DNA', () => { - cy.validateFacetFilter('Sample Type', 'DNA', 'DNA', /\d{1}/); - cy.validateFacetRank(0, 'Sample Type'); - }); - - it('Parent Sample Type - Peripheral Whole Blood', () => { - cy.validateFacetFilter('Parent Sample Type', 'Peripheral Whole Blood', 'Peripheral Whole Blood', /\d{1}/); - cy.validateFacetRank(1, 'Parent Sample Type'); - }); - - it('Collection Sample Type - Peripheral Whole Blood', () => { - cy.validateFacetFilter('Collection Sample Type', 'Peripheral Whole Blood', 'Peripheral Whole Blood', /\d{1}/); - cy.validateFacetRank(2, 'Collection Sample Type'); - }); - - it('Age at Biospecimen Collection (days)', () => { - cy.validateFacetNumFilter('Max', 'Age at Biospecimen Collection (days)', '0.01', /\d{1}/); - cy.validateFacetRank(3, 'Age at Biospecimen Collection (days)'); - }); - - it('Availability - Available', () => { - cy.validateFacetFilter('Availability', 'Available', 'available', /\d{1}/); - cy.validateFacetRank(4, 'Availability'); - }); - - it('Laboratory Procedure - Centrifugation', () => { - cy.validateFacetFilter('Laboratory Procedure', 'Centrifugation', 'Centrifugation', /\d{1}/); - cy.validateFacetRank(5, 'Laboratory Procedure'); - }); - - it('Biospecimen Storage - -80C Freezer', () => { - cy.validateFacetFilter('Biospecimen Storage', '-80C Freezer', '-80C Freezer', /\d{1}/); - cy.validateFacetRank(6, 'Biospecimen Storage'); - }); -}); - -describe('Page Data Exploration (Data Files) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitDataExploration('datafiles'); - cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('Search by File ID - HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz', () => { - cy.get('[class*="SearchLabel_title"]').contains('Search by File ID').should('exist'); //data-cy="SearchLabel_Title" - - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); //data-cy="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.HTP0577A FRRB192320222-1a HWHKMDSXX L1 2.fq.gz').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz" - }); - - it('Access - Controlled', () => { - cy.validateFacetFilter('Access', 'Controlled', 'Controlled', /\d{1}/); - cy.validateFacetRank(0, 'Access'); - }); - - it('Dataset - HTP Whole Blood RNAseq (2020)', () => { - cy.validateFacetFilter('Dataset', 'HTP Whole Blood RNAseq (2020)', 'HTP Whole Blood RNAseq (2020)', /\d{1}/); - cy.validateFacetRank(1, 'Dataset'); - }); - - it('Data Category - Genomics', () => { - cy.validateFacetFilter('Data Category', 'Genomics', 'Genomics', /\d{1}/); - cy.validateFacetRank(2, 'Data Category'); - }); - - it('Data Type - GVCF', () => { - cy.validateFacetFilter('Data Type', 'GVCF', 'gVCF', /\d{1}/); - cy.validateFacetRank(3, 'Data Type'); - }); - - it('Experimental Strategy - Whole Genome Sequencing', () => { - cy.validateFacetFilter('Experimental Strategy', 'Whole Genome Sequencing', 'Whole Genome Sequencing', /\d{1}/); - cy.validateFacetRank(4, 'Experimental Strategy'); - }); - - it('File Format - gVCF [SJIP-553]', () => { - cy.validateFacetFilter('File Format', 'GVCF', 'gvcf', /\d{1}/); - cy.validateFacetRank(5, 'File Format'); - }); - - it('ACL - Open Access', () => { - cy.validateFacetFilter('ACL', 'Open Access', 'open_access', /\d{1}/); - cy.validateFacetRank(6, 'ACL'); - }); -}); diff --git a/cypress/e2e/Facettes/PageDataExploration_1.cy.ts b/cypress/e2e/Facettes/PageDataExploration_1.cy.ts new file mode 100644 index 00000000..4acf385a --- /dev/null +++ b/cypress/e2e/Facettes/PageDataExploration_1.cy.ts @@ -0,0 +1,125 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page Data Exploration (Participants) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').its('length').should('eq', 2); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('Search by Participant ID - pt-as0aepqm', () => { + cy.get('[class*="SearchLabel_title"]').contains('Search by Participant ID').should('exist'); //data-cy="SearchLabel_Title" + + cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" + cy.get('div[class="ant-tooltip-inner"]').contains('Search by Participant ID or External Participant ID').should('exist'); + + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'PT-AS0AEPQM', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('pt-as0aepqm').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('pt-as0aepqm').should('exist'); //data-cy="Tag_pt-as0aepqm" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_pt-as0aepqm" + }); + + it('Search by external Participant ID - HTP0577', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'htp0577', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('pt-as0aepqm').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('pt-as0aepqm').should('exist'); //data-cy="Tag_pt-as0aepqm" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Participant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Pt-as0aepqm').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_pt-as0aepqm" + }); + + it('Study Code - DS360-CHD', () => { + cy.validateFacetFilter('Study Code', 'DS360-CHD', 'DS360-CHD', /\d{1}/); + cy.validateFacetRank(0, 'Study Code'); + }); + + it('Down Syndrome Status - T21 [SJIP-553]', () => { + cy.validateFacetFilter('Down Syndrome Status', 'T21', 'T21', /\d{1}/); + cy.validateFacetRank(1, 'Down Syndrome Status'); + }); + + it('Diagnosis (MONDO)', () => { + cy.get('div[class*="CollapsePlaceHolderFacet_collapseLikeFacet"]').eq(0).contains('Diagnosis (MONDO)').should('exist'); + // TODO Filtrer + }); + + it('Phenotype (HPO)', () => { + cy.get('div[class*="CollapsePlaceHolderFacet_collapseLikeFacet"]').eq(1).contains('Phenotype (HPO)').should('exist'); + // TODO Filtrer + }); + + it('Condition (Source Text) - Complete trisomy 21', () => { + cy.validateFacetFilter('Condition (Source Text)', 'Complete trisomy 21', 'Complete trisomy 21', /\d{1}/); + cy.validateFacetRank(2, 'Condition (Source Text)'); + }); + + it('Age at Diagnosis (days)', () => { + cy.validateFacetNumFilter('Max', 'Age at Diagnosis (days)', '10000', /\d{1}/); + cy.validateFacetRank(3, 'Age at Diagnosis (days)'); + }); + + it('Age at Vital Status (days)', () => { + cy.validateFacetNumFilter('Max', 'Age at Vital Status (days)', '10000', /\d{1}/); + cy.validateFacetRank(4, 'Age at Vital Status (days)'); + }); + + it('Age at Observed Phenotype (days)', () => { + cy.validateFacetNumFilter('Max', 'Age at Observed Phenotype (days)', '10000', /\d{1}/); + cy.validateFacetRank(5, 'Age at Observed Phenotype (days)'); + }); + + it('Age at First Patient Engagement (days)', () => { + cy.validateFacetNumFilter('Max', 'Age at First Patient Engagement (days)', '10000', /\d{1}/); + cy.validateFacetRank(6, 'Age at First Patient Engagement (days)'); + }); + + it('Family Unit - Proband-only', () => { + cy.validateFacetFilter('Family Unit', 'Proband-only', 'proband-only', /\d{1}/); + cy.validateFacetRank(7, 'Family Unit'); + }); + + it('Sex - Female', () => { + cy.validateFacetFilter('Sex', 'Female', 'female', /\d{1}/); + cy.validateFacetRank(8, 'Sex'); + }); + + it('Race - White', () => { + cy.validateFacetFilter('Race', 'White', 'White', /\d{1}/); + cy.validateFacetRank(9, 'Race'); + }); + + it('Ethnicity - Not Hispanic or Latino', () => { + cy.validateFacetFilter('Ethnicity', 'Not Hispanic or Latino', 'Not Hispanic or Latino', /\d{1}/); + cy.validateFacetRank(10, 'Ethnicity'); + }); + + it('Vital Status - Alive', () => { + cy.validateFacetFilter('Vital Status', 'Alive', 'Alive', /\d{1}/); + cy.validateFacetRank(11, 'Vital Status'); + }); +}); diff --git a/cypress/e2e/Facettes/PageDataExploration_2.cy.ts b/cypress/e2e/Facettes/PageDataExploration_2.cy.ts new file mode 100644 index 00000000..ad2cedaa --- /dev/null +++ b/cypress/e2e/Facettes/PageDataExploration_2.cy.ts @@ -0,0 +1,124 @@ +/// +import '../../support/commands'; +import { oneMinute } from '../../support/utils'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('biospecimens'); + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page Data Exploration (Biospecimens) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('Search by Sample ID - bs-03ynynfs', () => { + cy.get('[class*="SearchLabel_title"]').contains('Search by Sample ID').should('exist'); //data-cy="SearchLabel_Title" + + cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" + cy.get('div[class="ant-tooltip-inner"]').contains('Search by Sample ID or External Sample ID').should('exist'); + + cy.intercept('POST', '*/grapgql').as('getRouteMatcher'); + cy.get('[class*="SearchAutocomplete_search"]').eq(0).find('input').type('BS-03YNYNFS', {force: true}); //data-cy="SearchAutocomplete_Select" + cy.waitWhileSpin(oneMinute); + cy.wait('@getRouteMatcher'); + cy.wait('@getRouteMatcher'); + cy.wait('@getRouteMatcher'); + cy.wait(2000); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('bs-03ynynfs').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('bs-03ynynfs').should('exist'); //data-cy="Tag_bs-03ynynfs" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Sample ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-03ynynfs').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_bs-03ynynfs" + }); + + it('Search by external Sample ID - HTP0577A_PAXgeneWholeBloodRNA', () => { + cy.intercept('POST', '*/grapgql').as('getRouteMatcher'); + cy.get('[class*="SearchAutocomplete_search"]').eq(0).find('input').type('htp0577a_paxgenewholebloodrna', {force: true}); //data-cy="SearchAutocomplete_Select" + cy.waitWhileSpin(oneMinute); + cy.wait('@getRouteMatcher'); + cy.wait('@getRouteMatcher'); + cy.wait('@getRouteMatcher'); + cy.wait(2000); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('bs-03ynynfs').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_bs-03ynynfs" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Sample ID').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_bs-03ynynfs" + }); + + it('Search by Collection ID - bs-m623h3mrgg', () => { + cy.get('[class*="SearchLabel_title"]').contains('Search by Collection ID').should('exist'); //data-cy="SearchLabel_Title" + + cy.intercept('POST', '*/grapgql').as('getRouteMatcher'); + cy.get('[class*="SearchAutocomplete_search"]').eq(1).find('input').type('BS-M623H3MRGG', {force: true}); //data-cy="SearchAutocomplete_Select" + cy.waitWhileSpin(oneMinute); + cy.wait('@getRouteMatcher'); + cy.wait('@getRouteMatcher'); + cy.wait('@getRouteMatcher'); + cy.wait(2000); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('bs-m623h3mrgg').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('bs-m623h3mrgg').should('exist'); //data-cy="Tag_bs-m623h3mrgg" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Collection ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Bs-m623h3mrgg').should('exist'); + cy.validateTableResultsCount(/\d{1}/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_bs-m623h3mrgg" + }); + + it('Sample Type - DNA', () => { + cy.validateFacetFilter('Sample Type', 'DNA', 'DNA', /\d{1}/); + cy.validateFacetRank(0, 'Sample Type'); + }); + + it('Parent Sample Type - Peripheral Whole Blood', () => { + cy.validateFacetFilter('Parent Sample Type', 'Peripheral Whole Blood', 'Peripheral Whole Blood', /\d{1}/); + cy.validateFacetRank(1, 'Parent Sample Type'); + }); + + it('Collection Sample Type - Peripheral Whole Blood', () => { + cy.validateFacetFilter('Collection Sample Type', 'Peripheral Whole Blood', 'Peripheral Whole Blood', /\d{1}/); + cy.validateFacetRank(2, 'Collection Sample Type'); + }); + + it('Age at Biospecimen Collection (days)', () => { + cy.validateFacetNumFilter('Max', 'Age at Biospecimen Collection (days)', '0.01', /\d{1}/); + cy.validateFacetRank(3, 'Age at Biospecimen Collection (days)'); + }); + + it('Availability - Available', () => { + cy.validateFacetFilter('Availability', 'Available', 'available', /\d{1}/); + cy.validateFacetRank(4, 'Availability'); + }); + + it('Laboratory Procedure - Centrifugation', () => { + cy.validateFacetFilter('Laboratory Procedure', 'Centrifugation', 'Centrifugation', /\d{1}/); + cy.validateFacetRank(5, 'Laboratory Procedure'); + }); + + it('Biospecimen Storage - -80C Freezer', () => { + cy.validateFacetFilter('Biospecimen Storage', '-80C Freezer', '-80C Freezer', /\d{1}/); + cy.validateFacetRank(6, 'Biospecimen Storage'); + }); +}); diff --git a/cypress/e2e/Facettes/PageDataExploration_3.cy.ts b/cypress/e2e/Facettes/PageDataExploration_3.cy.ts new file mode 100644 index 00000000..7425218d --- /dev/null +++ b/cypress/e2e/Facettes/PageDataExploration_3.cy.ts @@ -0,0 +1,73 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('datafiles'); + cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page Data Exploration (Data Files) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('Search by File ID - HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz', () => { + cy.get('[class*="SearchLabel_title"]').contains('Search by File ID').should('exist'); //data-cy="SearchLabel_Title" + + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); //data-cy="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP.HTP0577A FRRB192320222-1a HWHKMDSXX L1 2.fq.gz').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz" + }); + + it('Access - Controlled', () => { + cy.validateFacetFilter('Access', 'Controlled', 'Controlled', /\d{1}/); + cy.validateFacetRank(0, 'Access'); + }); + + it('Dataset - HTP Whole Blood RNAseq (2020)', () => { + cy.validateFacetFilter('Dataset', 'HTP Whole Blood RNAseq (2020)', 'HTP Whole Blood RNAseq (2020)', /\d{1}/); + cy.validateFacetRank(1, 'Dataset'); + }); + + it('Data Category - Genomics', () => { + cy.validateFacetFilter('Data Category', 'Genomics', 'Genomics', /\d{1}/); + cy.validateFacetRank(2, 'Data Category'); + }); + + it('Data Type - GVCF', () => { + cy.validateFacetFilter('Data Type', 'GVCF', 'gVCF', /\d{1}/); + cy.validateFacetRank(3, 'Data Type'); + }); + + it('Experimental Strategy - Whole Genome Sequencing', () => { + cy.validateFacetFilter('Experimental Strategy', 'Whole Genome Sequencing', 'Whole Genome Sequencing', /\d{1}/); + cy.validateFacetRank(4, 'Experimental Strategy'); + }); + + it('File Format - gVCF [SJIP-553]', () => { + cy.validateFacetFilter('File Format', 'GVCF', 'gvcf', /\d{1}/); + cy.validateFacetRank(5, 'File Format'); + }); + + it('ACL - Open Access', () => { + cy.validateFacetFilter('ACL', 'Open Access', 'open_access', /\d{1}/); + cy.validateFacetRank(6, 'ACL'); + }); +}); diff --git a/cypress/e2e/Facettes/PageStudies.cy.ts b/cypress/e2e/Facettes/PageStudies.cy.ts index f4513bce..1a493ac3 100644 --- a/cypress/e2e/Facettes/PageStudies.cy.ts +++ b/cypress/e2e/Facettes/PageStudies.cy.ts @@ -3,13 +3,10 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitStudiesPage(); }); describe('Page des études - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitStudiesPage(); - }); - it('Expand all/Collapse all', () => { cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); diff --git a/cypress/e2e/Facettes/PageVariants.cy.ts b/cypress/e2e/Facettes/PageVariants.cy.ts deleted file mode 100644 index 7af733d0..00000000 --- a/cypress/e2e/Facettes/PageVariants.cy.ts +++ /dev/null @@ -1,444 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page des variants (Participant) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitVariantsPage(); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('Study Code - DS360-CHD', () => { - cy.validateFacetFilter('Study Code', 'DS360-CHD', 'DS360-CHD', /^441,546$/); - cy.validateFacetRank(0, 'Study Code'); - }); -}); - -describe('Page des variants (Variant) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitVariantsPage(); - cy.get('[data-cy="SidebarMenuItem_Variant"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('Search by variant locus - 1-108192590-T-C [SJIP-705]', () => { - cy.get('[class*="SearchLabel_title"]').contains('Search by variant').should('exist'); //data-cy="SearchLabel_Title" - - cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" - cy.get('div[class="ant-tooltip-inner"]').contains('Enter Variant Locus, Gene Symbol, Gene Alias, Gene AA Change, dbSNP ID, ClinVar ID, Ensembl ID, refseq ID').should('exist'); - - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', '1-108192590-t-c', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by gene symbol - PRDX1 [SJIP-705]', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'prdx1', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by gene alias - NKEFA [SJIP-844]', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'nkefa', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by gene AA change - p.Tyr11Cys [SJIP-845]', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'p.tyr11cys', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by dbSNP ID - rs79735952 [SJIP-845]', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'RS79735952', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by ClinVar ID - 1267873 [SJIP-845]', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', '1267873', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by Ensembl ID - ENST00000370041', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'enst00000370041', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Search by refseq ID - NM_013386', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'nm_013386', 'POST', '* /grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.validateTableResultsCount(/^1 Result$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" - }); - - it('Variant Type - SNV', () => { - cy.validateFacetFilter('Variant Type', 'SNV', 'SNV', /^515,337$/); - cy.validateFacetRank(0, 'Variant Type'); - }); - - it('Consequence - Intron', () => { - cy.validateFacetFilter('Consequence', 'Intron', 'intron', /^239,729$/); - cy.validateFacetRank(1, 'Consequence'); - }); - - it('Consequence - Missense', () => { - cy.validateFacetFilter('Consequence', 'Missense', 'missense', /^4,455$/); - }); - - it('Variant External Reference - DBSNP [SJIP-601]', () => { - cy.validateFacetFilter('Variant External Reference', 'DBSNP', 'DBSNP', /^463,991$/); - cy.validateFacetRank(2, 'Variant External Reference'); - }); - - it('Chromosome - 1', () => { - cy.validateFacetFilter('Chromosome', '1', '1', /^644,139$/); - cy.validateFacetRank(3, 'Chromosome'); - }); - - it('Position', () => { - cy.validateFacetNumFilter('MinMax', 'Position', '108192590', /^1$/); - cy.validateFacetRank(4, 'Position'); - }); - - it('Zygosity - Heterozygote', () => { - cy.validateFacetFilter('Zygosity', 'Heterozygote', 'HET', /^635,234$/); - cy.validateFacetRank(5, 'Zygosity'); - }); - - it('Transmission - Autosomal Recessive', () => { - cy.validateFacetFilter('Transmission', 'Autosomal Recessive', 'autosomal_recessive', /^74,072$/); - cy.validateFacetRank(6, 'Transmission'); - }); -}); - -describe('Page des variants (Gene) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitVariantsPage(); - cy.get('[data-cy="SidebarMenuItem_Gene"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('Search by gene symbol - PRDX1 [SJIP-707]', () => { - cy.get('[class*="SearchLabel_title"]').contains('Search by gene').should('exist'); //data-cy="SearchLabel_Title" - - cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" - cy.get('div[class="ant-tooltip-inner"]').contains('Enter a Gene Symbol, Gene Alias or Ensemble ID').should('exist'); - - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'prdx1', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('PRDX1').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('PRDX1').should('exist'); //data-cy="Tag_PRDX1" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Genes Symbol').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PRDX1').should('exist'); - cy.validateTableResultsCount(/^61$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_PRDX1" - }); - - it('Search by gene alias - NKEFA', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'nkefa', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('PRDX1').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('PRDX1').should('exist'); //data-cy="Tag_PRDX1" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Genes Symbol').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PRDX1').should('exist'); - cy.validateTableResultsCount(/^61$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_PRDX1" - }); - - it('Search by Ensembl ID - ENSG00000117450', () => { - cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'ensg00000117450', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('PRDX1').should('exist'); //data-cy="Search_Dropdown" - cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" - - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('PRDX1').should('exist'); //data-cy="Tag_PRDX1" - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Genes Symbol').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PRDX1').should('exist'); - cy.validateTableResultsCount(/^61$/); - - cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); - cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_PRDX1" - }); - - it('Gene Type - Protein Coding', () => { - cy.validateFacetFilter('Gene Type', 'Protein Coding', 'protein_coding', /^262,588$/); - cy.validateFacetRank(0, 'Gene Type'); - }); - - it('Gene External Reference - OMIM', () => { - cy.validateFacetFilter('Gene External Reference', 'OMIM', 'OMIM', /^77,148$/); - cy.validateFacetRank(1, 'Gene External Reference'); - }); - - it('gnomAD pLI', () => { - cy.validateFacetNumFilter('Min', 'gnomAD pLI', '0.01', /^129,754$/); - cy.validateFacetRank(2, 'gnomAD pLI'); - }); - - it('gnomAD LOEUF', () => { - cy.validateFacetNumFilter('Max', 'gnomAD LOEUF', '0.05', /^190$/); - cy.validateFacetRank(3, 'gnomAD LOEUF'); - }); - - it('HPO - Autosomal recessive inheritance (HP:0000007)', () => { - cy.get('[data-cy="FilterContainer_HPO"]').should('exist'); - cy.validateFacetRank(4, 'HPO'); - /* Fait planter Cypress - cy.validateFacetFilter('HPO', 'Autosomal recessive inheritance (HP:0000007)', 'Autosomal recessive inheritance (HP:0000007)', /^47,253$/); - */ - }); - - it('ORPHANET - Retinitis pigmentosa', () => { - cy.get('[data-cy="FilterContainer_ORPHANET"]').should('exist'); - cy.validateFacetRank(5, 'ORPHANET'); - /* Fait planter Cypress - cy.validateFacetFilter('ORPHANET', 'Retinitis pigmentosa', 'Retinitis pigmentosa', /^2,816$/); - */ - }); - - it('OMIM - Spinocerebellar ataxia 37', () => { - cy.get('[data-cy="FilterContainer_OMIM"]').should('exist'); - cy.validateFacetRank(6, 'OMIM'); - /* Fait planter Cypress - cy.validateFacetFilter('OMIM', 'Spinocerebellar ataxia 37', 'Spinocerebellar ataxia 37', /^3,006$/); - */ - }); - - it('DDD - CEREBELLAR ATAXIA, NONPROGRESSIVE, WITH INTELLECTUAL DEVELOPMENTAL DISORDER', () => { - cy.validateFacetFilter('DDD', 'CEREBELLAR ATAXIA, NONPROGRESSIVE, WITH INTELLECTUAL DEVELOPMENTAL DISORDER', 'CEREBELLAR ATAXIA, NONPROGRESSIVE, WITH INTELLECTUAL DEVELOPMENTAL DISORDER', /^2,330$/); - cy.validateFacetRank(7, 'DDD'); - }); - - it('COSMIC - Paraganglioma', () => { - cy.validateFacetFilter('COSMIC', 'Paraganglioma', 'paraganglioma', /^267$/); - cy.validateFacetRank(8, 'COSMIC'); - }); -}); - -describe('Page des variants (Pathogenicity) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitVariantsPage(); - cy.get('[data-cy="SidebarMenuItem_Pathogenicity"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('ClinVar - Likely Benign', () => { - cy.validateFacetFilter('ClinVar', 'Likely Benign', 'Likely_benign', /^872$/); - cy.validateFacetRank(0, 'ClinVar'); - }); - - it('VEP - MODIFIER', () => { - cy.validateFacetFilter('VEP', 'MODIFIER', 'MODIFIER', /^563,410$/); - cy.validateFacetRank(1, 'VEP'); - }); - - it('CADD (Raw)', () => { - cy.validateFacetNumFilter('Min', 'CADD (Raw)', '0.01', /^3,763$/); - cy.validateFacetRank(2, 'CADD (Raw)'); - }); - - it('CADD (Phred)', () => { - cy.validateFacetNumFilter('Min', 'CADD (Phred)', '0.01', /^4,303$/); - cy.validateFacetRank(3, 'CADD (Phred)'); - }); - - it('DANN', () => { - cy.validateFacetNumFilter('Min', 'DANN', '0.1', /^4,269$/); - cy.validateFacetRank(4, 'DANN'); - }); - - it('FATHMM - Tolerated', () => { - cy.validateFacetFilter('FATHMM', 'Tolerated', 'T', /^3,193$/); - cy.validateFacetRank(5, 'FATHMM'); - }); - - it('LRT - Neutral', () => { - cy.validateFacetFilter('LRT', 'Neutral', 'N', /^2,493$/); - cy.validateFacetRank(6, 'LRT'); - }); - - it('PolyPhen-2 HVAR - Benign', () => { - cy.validateFacetFilter('PolyPhen-2 HVAR', 'Benign', 'B', /^2,778$/); - cy.validateFacetRank(7, 'PolyPhen-2 HVAR'); - }); - - it('REVEL', () => { - cy.validateFacetNumFilter('Min', 'REVEL', '0.01', /^3,755$/); - cy.validateFacetRank(8, 'REVEL'); - }); - - it('SpliceAI', () => { - cy.validateFacetNumFilter('Min', 'SpliceAI', '0.01', /^12,708$/); - cy.validateFacetRank(9, 'SpliceAI'); - }); - - it('SIFT - Tolerated', () => { - cy.validateFacetFilter('SIFT', 'Tolerated', 'T', /^2,786$/); - cy.validateFacetRank(10, 'SIFT'); - }); -}); - -describe('Page des variants (Frequency) - Filtrer avec les facettes', () => { - beforeEach(() => { - cy.visitVariantsPage(); - cy.get('[data-cy="SidebarMenuItem_Frequency"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" - }); - - it('Expand all/Collapse all', () => { - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); - - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" - cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); - cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); - }); - - it('INCLUDE Allele Frequency', () => { - cy.validateFacetNumFilter('Max', 'INCLUDE Allele Frequency', '0.01', /^508,593$/); - cy.validateFacetRank(0, 'INCLUDE Allele Frequency'); - }); - - it('gnomAD Genome 2.1.1', () => { - cy.validateFacetNumFilter('Max', 'gnomAD Genome 2.1.1', '0.01', /^237,252$/); - cy.validateFacetRank(1, 'gnomAD Genome 2.1.1'); - }); - - it('gnomAD Genome 3.1.2', () => { - cy.validateFacetNumFilter('Max', 'gnomAD Genome 3.1.2', '0.01', /^332,929$/); - cy.validateFacetRank(2, 'gnomAD Genome 3.1.2'); - }); - - it('gnomAD Exome 2.1.1', () => { - cy.validateFacetNumFilter('Max', 'gnomAD Exome 2.1.1', '0.01', /^7,524$/); - cy.validateFacetRank(3, 'gnomAD Exome 2.1.1'); - }); - - it('TopMed', () => { - cy.validateFacetNumFilter('Max', 'TopMed', '0.01', /^314,723$/); - cy.validateFacetRank(4, 'TopMed'); - }); - - it('1000 Genomes', () => { - cy.validateFacetNumFilter('Max', '1000 Genomes', '0.01', /^1,241$/); - cy.validateFacetRank(5, '1000 Genomes'); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/Facettes/PageVariants_1.cy.ts b/cypress/e2e/Facettes/PageVariants_1.cy.ts new file mode 100644 index 00000000..d25154db --- /dev/null +++ b/cypress/e2e/Facettes/PageVariants_1.cy.ts @@ -0,0 +1,27 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page des variants (Participant) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('Study Code - DS360-CHD', () => { + cy.validateFacetFilter('Study Code', 'DS360-CHD', 'DS360-CHD', /^441,546$/); + cy.validateFacetRank(0, 'Study Code'); + }); +}); diff --git a/cypress/e2e/Facettes/PageVariants_2.cy.ts b/cypress/e2e/Facettes/PageVariants_2.cy.ts new file mode 100644 index 00000000..b28d4503 --- /dev/null +++ b/cypress/e2e/Facettes/PageVariants_2.cy.ts @@ -0,0 +1,174 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[data-cy="SidebarMenuItem_Variant"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" +}); + +describe('Page des variants (Variant) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('Search by variant locus - 1-108192590-T-C [SJIP-705]', () => { + cy.get('[class*="SearchLabel_title"]').contains('Search by variant').should('exist'); //data-cy="SearchLabel_Title" + + cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" + cy.get('div[class="ant-tooltip-inner"]').contains('Enter Variant Locus, Gene Symbol, Gene Alias, Gene AA Change, dbSNP ID, ClinVar ID, Ensembl ID, refseq ID').should('exist'); + + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', '1-108192590-t-c', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by gene symbol - PRDX1 [SJIP-705]', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'prdx1', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by gene alias - NKEFA [SJIP-844]', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'nkefa', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by gene AA change - p.Tyr11Cys [SJIP-845]', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'p.tyr11cys', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by dbSNP ID - rs79735952 [SJIP-845]', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'RS79735952', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by ClinVar ID - 1267873 [SJIP-845]', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', '1267873', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-108192590-T-C').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('1-108192590-T-C').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('1-108192590-T-C').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by Ensembl ID - ENST00000370041', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'enst00000370041', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Search by refseq ID - NM_013386', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'nm_013386', 'POST', '* /grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('1-').should('exist'); + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('exist'); //data-cy="Tag_1-108192590-T-C" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.validateTableResultsCount(/^1 Result$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_1-108192590-T-C" + }); + + it('Variant Type - SNV', () => { + cy.validateFacetFilter('Variant Type', 'SNV', 'SNV', /^515,337$/); + cy.validateFacetRank(0, 'Variant Type'); + }); + + it('Consequence - Intron', () => { + cy.validateFacetFilter('Consequence', 'Intron', 'intron', /^239,729$/); + cy.validateFacetRank(1, 'Consequence'); + }); + + it('Consequence - Missense', () => { + cy.validateFacetFilter('Consequence', 'Missense', 'missense', /^4,455$/); + }); + + it('Variant External Reference - DBSNP [SJIP-601]', () => { + cy.validateFacetFilter('Variant External Reference', 'DBSNP', 'DBSNP', /^463,991$/); + cy.validateFacetRank(2, 'Variant External Reference'); + }); + + it('Chromosome - 1', () => { + cy.validateFacetFilter('Chromosome', '1', '1', /^644,139$/); + cy.validateFacetRank(3, 'Chromosome'); + }); + + it('Position', () => { + cy.validateFacetNumFilter('MinMax', 'Position', '108192590', /^1$/); + cy.validateFacetRank(4, 'Position'); + }); + + it('Zygosity - Heterozygote', () => { + cy.validateFacetFilter('Zygosity', 'Heterozygote', 'HET', /^635,234$/); + cy.validateFacetRank(5, 'Zygosity'); + }); + + it('Transmission - Autosomal Recessive', () => { + cy.validateFacetFilter('Transmission', 'Autosomal Recessive', 'autosomal_recessive', /^74,072$/); + cy.validateFacetRank(6, 'Transmission'); + }); +}); diff --git a/cypress/e2e/Facettes/PageVariants_3.cy.ts b/cypress/e2e/Facettes/PageVariants_3.cy.ts new file mode 100644 index 00000000..49155547 --- /dev/null +++ b/cypress/e2e/Facettes/PageVariants_3.cy.ts @@ -0,0 +1,123 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[data-cy="SidebarMenuItem_Gene"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page des variants (Gene) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('Search by gene symbol - PRDX1 [SJIP-707]', () => { + cy.get('[class*="SearchLabel_title"]').contains('Search by gene').should('exist'); //data-cy="SearchLabel_Title" + + cy.get('[class*="SearchLabel_tooltipIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); //data-cy="SearchLabel_InfoCircleOutlined" + cy.get('div[class="ant-tooltip-inner"]').contains('Enter a Gene Symbol, Gene Alias or Ensemble ID').should('exist'); + + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'prdx1', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('PRDX1').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('PRDX1').should('exist'); //data-cy="Tag_PRDX1" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Genes Symbol').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PRDX1').should('exist'); + cy.validateTableResultsCount(/^61$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_PRDX1" + }); + + it('Search by gene alias - NKEFA', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'nkefa', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('PRDX1').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('PRDX1').should('exist'); //data-cy="Tag_PRDX1" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Genes Symbol').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PRDX1').should('exist'); + cy.validateTableResultsCount(/^61$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_PRDX1" + }); + + it('Search by Ensembl ID - ENSG00000117450', () => { + cy.typeAndIntercept('[class*="SearchAutocomplete_search"]', 'ensg00000117450', 'POST', '*/grapgql', 3); //data-cy="SearchAutocomplete_Select" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').contains('PRDX1').should('exist'); //data-cy="Search_Dropdown" + cy.get('[class*="ant-select-dropdown"] [class*="ant-select-item"]').eq(0).click({force: true}); //data-cy="Search_Dropdown" + + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').contains('PRDX1').should('exist'); //data-cy="Tag_PRDX1" + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Genes Symbol').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('PRDX1').should('exist'); + cy.validateTableResultsCount(/^61$/); + + cy.get('[data-icon="close-circle"]').clickAndWait({force: true}); + cy.get('[class*="SearchAutocomplete_search"] [class*="ant-tag"]').should('not.exist'); //data-cy="Tag_PRDX1" + }); + + it('Gene Type - Protein Coding', () => { + cy.validateFacetFilter('Gene Type', 'Protein Coding', 'protein_coding', /^262,588$/); + cy.validateFacetRank(0, 'Gene Type'); + }); + + it('Gene External Reference - OMIM', () => { + cy.validateFacetFilter('Gene External Reference', 'OMIM', 'OMIM', /^77,148$/); + cy.validateFacetRank(1, 'Gene External Reference'); + }); + + it('gnomAD pLI', () => { + cy.validateFacetNumFilter('Min', 'gnomAD pLI', '0.01', /^129,754$/); + cy.validateFacetRank(2, 'gnomAD pLI'); + }); + + it('gnomAD LOEUF', () => { + cy.validateFacetNumFilter('Max', 'gnomAD LOEUF', '0.05', /^190$/); + cy.validateFacetRank(3, 'gnomAD LOEUF'); + }); + + it('HPO - Autosomal recessive inheritance (HP:0000007)', () => { + cy.get('[data-cy="FilterContainer_HPO"]').should('exist'); + cy.validateFacetRank(4, 'HPO'); + /* Fait planter Cypress + cy.validateFacetFilter('HPO', 'Autosomal recessive inheritance (HP:0000007)', 'Autosomal recessive inheritance (HP:0000007)', /^47,253$/); + */ + }); + + it('ORPHANET - Retinitis pigmentosa', () => { + cy.get('[data-cy="FilterContainer_ORPHANET"]').should('exist'); + cy.validateFacetRank(5, 'ORPHANET'); + /* Fait planter Cypress + cy.validateFacetFilter('ORPHANET', 'Retinitis pigmentosa', 'Retinitis pigmentosa', /^2,816$/); + */ + }); + + it('OMIM - Spinocerebellar ataxia 37', () => { + cy.get('[data-cy="FilterContainer_OMIM"]').should('exist'); + cy.validateFacetRank(6, 'OMIM'); + /* Fait planter Cypress + cy.validateFacetFilter('OMIM', 'Spinocerebellar ataxia 37', 'Spinocerebellar ataxia 37', /^3,006$/); + */ + }); + + it('DDD - CEREBELLAR ATAXIA, NONPROGRESSIVE, WITH INTELLECTUAL DEVELOPMENTAL DISORDER', () => { + cy.validateFacetFilter('DDD', 'CEREBELLAR ATAXIA, NONPROGRESSIVE, WITH INTELLECTUAL DEVELOPMENTAL DISORDER', 'CEREBELLAR ATAXIA, NONPROGRESSIVE, WITH INTELLECTUAL DEVELOPMENTAL DISORDER', /^2,330$/); + cy.validateFacetRank(7, 'DDD'); + }); + + it('COSMIC - Paraganglioma', () => { + cy.validateFacetFilter('COSMIC', 'Paraganglioma', 'paraganglioma', /^267$/); + cy.validateFacetRank(8, 'COSMIC'); + }); +}); diff --git a/cypress/e2e/Facettes/PageVariants_4.cy.ts b/cypress/e2e/Facettes/PageVariants_4.cy.ts new file mode 100644 index 00000000..0a816508 --- /dev/null +++ b/cypress/e2e/Facettes/PageVariants_4.cy.ts @@ -0,0 +1,77 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[data-cy="SidebarMenuItem_Pathogenicity"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page des variants (Pathogenicity) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('ClinVar - Likely Benign', () => { + cy.validateFacetFilter('ClinVar', 'Likely Benign', 'Likely_benign', /^872$/); + cy.validateFacetRank(0, 'ClinVar'); + }); + + it('VEP - MODIFIER', () => { + cy.validateFacetFilter('VEP', 'MODIFIER', 'MODIFIER', /^563,410$/); + cy.validateFacetRank(1, 'VEP'); + }); + + it('CADD (Raw)', () => { + cy.validateFacetNumFilter('Min', 'CADD (Raw)', '0.01', /^3,763$/); + cy.validateFacetRank(2, 'CADD (Raw)'); + }); + + it('CADD (Phred)', () => { + cy.validateFacetNumFilter('Min', 'CADD (Phred)', '0.01', /^4,303$/); + cy.validateFacetRank(3, 'CADD (Phred)'); + }); + + it('DANN', () => { + cy.validateFacetNumFilter('Min', 'DANN', '0.1', /^4,269$/); + cy.validateFacetRank(4, 'DANN'); + }); + + it('FATHMM - Tolerated', () => { + cy.validateFacetFilter('FATHMM', 'Tolerated', 'T', /^3,193$/); + cy.validateFacetRank(5, 'FATHMM'); + }); + + it('LRT - Neutral', () => { + cy.validateFacetFilter('LRT', 'Neutral', 'N', /^2,493$/); + cy.validateFacetRank(6, 'LRT'); + }); + + it('PolyPhen-2 HVAR - Benign', () => { + cy.validateFacetFilter('PolyPhen-2 HVAR', 'Benign', 'B', /^2,778$/); + cy.validateFacetRank(7, 'PolyPhen-2 HVAR'); + }); + + it('REVEL', () => { + cy.validateFacetNumFilter('Min', 'REVEL', '0.01', /^3,755$/); + cy.validateFacetRank(8, 'REVEL'); + }); + + it('SpliceAI', () => { + cy.validateFacetNumFilter('Min', 'SpliceAI', '0.01', /^12,708$/); + cy.validateFacetRank(9, 'SpliceAI'); + }); + + it('SIFT - Tolerated', () => { + cy.validateFacetFilter('SIFT', 'Tolerated', 'T', /^2,786$/); + cy.validateFacetRank(10, 'SIFT'); + }); +}); diff --git a/cypress/e2e/Facettes/PageVariants_5.cy.ts b/cypress/e2e/Facettes/PageVariants_5.cy.ts new file mode 100644 index 00000000..cd389cd7 --- /dev/null +++ b/cypress/e2e/Facettes/PageVariants_5.cy.ts @@ -0,0 +1,52 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[data-cy="SidebarMenuItem_Frequency"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Collapse all').should('exist'); //data-cy="ExpandAll" +}); + +describe('Page des variants (Frequency) - Filtrer avec les facettes', () => { + it('Expand all/Collapse all', () => { + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('not.exist'); + + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').clickAndWait({force: true}); //data-cy="ExpandAll" + cy.get('[class*="Filters_filterExpandBtnWrapper"] button[class*="ant-btn-link"]').contains('Expand all').should('exist'); //data-cy="ExpandAll" + cy.get('section[class*="Filters"] [aria-expanded="false"]').should('exist'); + cy.get('section[class*="Filters"] [aria-expanded="true"]').should('not.exist'); + }); + + it('INCLUDE Allele Frequency', () => { + cy.validateFacetNumFilter('Max', 'INCLUDE Allele Frequency', '0.01', /^508,593$/); + cy.validateFacetRank(0, 'INCLUDE Allele Frequency'); + }); + + it('gnomAD Genome 2.1.1', () => { + cy.validateFacetNumFilter('Max', 'gnomAD Genome 2.1.1', '0.01', /^237,252$/); + cy.validateFacetRank(1, 'gnomAD Genome 2.1.1'); + }); + + it('gnomAD Genome 3.1.2', () => { + cy.validateFacetNumFilter('Max', 'gnomAD Genome 3.1.2', '0.01', /^332,929$/); + cy.validateFacetRank(2, 'gnomAD Genome 3.1.2'); + }); + + it('gnomAD Exome 2.1.1', () => { + cy.validateFacetNumFilter('Max', 'gnomAD Exome 2.1.1', '0.01', /^7,524$/); + cy.validateFacetRank(3, 'gnomAD Exome 2.1.1'); + }); + + it('TopMed', () => { + cy.validateFacetNumFilter('Max', 'TopMed', '0.01', /^314,723$/); + cy.validateFacetRank(4, 'TopMed'); + }); + + it('1000 Genomes', () => { + cy.validateFacetNumFilter('Max', '1000 Genomes', '0.01', /^1,241$/); + cy.validateFacetRank(5, '1000 Genomes'); + }); +}); diff --git a/cypress/e2e/Filtres/PageDataExploration_1.cy.ts b/cypress/e2e/Filtres/PageDataExploration_1.cy.ts new file mode 100644 index 00000000..9b29b3d6 --- /dev/null +++ b/cypress/e2e/Filtres/PageDataExploration_1.cy.ts @@ -0,0 +1,24 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.deleteFilterIfExists('Cypress_F0'); +}); + +describe('Page Data Exploration - Filtres', () => { + it('Créer un nouveau filtre', () => { + cy.saveFilterAs('Cypress_F0'); + + cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Cypress_F0$/).should('exist'); + cy.validateSelectedFilterInDropdown('Cypress_F0'); + cy.validateFilterInManager('Cypress_F0', 'exist'); + cy.validateIconStates('plus', false/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('copy', false/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('delete', false/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('share-alt', false/*isDisable*/, false/*isDirty*/); + }); +}); diff --git a/cypress/e2e/Filtres/PageDataExploration.cy.ts b/cypress/e2e/Filtres/PageDataExploration_2.cy.ts similarity index 60% rename from cypress/e2e/Filtres/PageDataExploration.cy.ts rename to cypress/e2e/Filtres/PageDataExploration_2.cy.ts index 4f92ec7f..a7c83701 100644 --- a/cypress/e2e/Filtres/PageDataExploration.cy.ts +++ b/cypress/e2e/Filtres/PageDataExploration_2.cy.ts @@ -5,34 +5,12 @@ beforeEach(() => { cy.login(); cy.visitDataExploration('participants'); cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.deleteFilterIfExists('Cypress_Fedit1'); + cy.deleteFilterIfExists('Cypress_F1 COPY'); + cy.createFilterIfNotExists('Cypress_F1'); }); describe('Page Data Exploration - Filtres', () => { - beforeEach(() => { - cy.deleteFilterIfExists('Cypress_F0'); - }); - - it('Créer un nouveau filtre', () => { - cy.saveFilterAs('Cypress_F0'); - - cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Cypress_F0$/).should('exist'); - cy.validateSelectedFilterInDropdown('Cypress_F0'); - cy.validateFilterInManager('Cypress_F0', 'exist'); - cy.validateIconStates('plus', false/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('copy', false/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('delete', false/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('share-alt', false/*isDisable*/, false/*isDirty*/); - }); -}); - -describe('Page Data Exploration - Filtres', () => { - beforeEach(() => { - cy.deleteFilterIfExists('Cypress_Fedit1'); - cy.deleteFilterIfExists('Cypress_F1 COPY'); - cy.createFilterIfNotExists('Cypress_F1'); - }); - it('Sélectionner un filtre dans la dropdown', () => { cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F1').clickAndWait({force: true}); @@ -108,48 +86,4 @@ describe('Page Data Exploration - Filtres', () => { cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); }); - - // Ne fonctionne pas, le popup "Copy to clipboard: ⌘+C, Enter" s'affiche et bloque le test - it.skip('Copier l\'url d\'un filtre', () => { - cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); - cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F1').clickAndWait({force: true}); - cy.get('[id="query-builder-header-tools"] [data-icon="share-alt"]').clickAndWait({force: true}); - // TODO: Récupérer l'rul copié et la valider - }); -}); - -describe('Page Data Exploration - Filtres', () => { - beforeEach(() => { - cy.createFilterIfNotExists('Cypress_F2'); - }); - - it('Supprimer un filtre par la querybar', () => { - cy.deleteFilter('Cypress_F2'); - - cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Untitled Filter$/).should('exist'); - cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); - cy.validateFilterInManager('Cypress_F2', 'not.exist'); - cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); - }); - - it('Supprimer un filtre par le manager', () => { - cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); - cy.get('[data-menu-id*="manage-my-filters"]').clickAndWait({force: true}); - cy.get('[class="ant-modal-content"]').contains('Cypress_F2').parentsUntil('li[class*="ListItemWithActions"]').parent().find('[data-icon="delete"]').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'POST', '**/graphql', 1); - cy.get('button[class="ant-modal-close"]').invoke('click'); - - cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains('Cypress_F2').should('not.exist'); - cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); - cy.validateFilterInManager('Cypress_F2', 'not.exist'); - cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); - }); }); diff --git a/cypress/e2e/Filtres/PageDataExploration_3.cy.ts b/cypress/e2e/Filtres/PageDataExploration_3.cy.ts new file mode 100644 index 00000000..dc42729a --- /dev/null +++ b/cypress/e2e/Filtres/PageDataExploration_3.cy.ts @@ -0,0 +1,41 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.createFilterIfNotExists('Cypress_F2'); +}); + +describe('Page Data Exploration - Filtres', () => { + it('Supprimer un filtre par la querybar', () => { + cy.deleteFilter('Cypress_F2'); + + cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Untitled Filter$/).should('exist'); + cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); + cy.validateFilterInManager('Cypress_F2', 'not.exist'); + cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); + }); + + it('Supprimer un filtre par le manager', () => { + cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); + cy.get('[data-menu-id*="manage-my-filters"]').clickAndWait({force: true}); + cy.get('[class="ant-modal-content"]').contains('Cypress_F2').parentsUntil('li[class*="ListItemWithActions"]').parent().find('[data-icon="delete"]').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'POST', '**/graphql', 1); + cy.get('button[class="ant-modal-close"]').invoke('click'); + + cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains('Cypress_F2').should('not.exist'); + cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); + cy.validateFilterInManager('Cypress_F2', 'not.exist'); + cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); + }); +}); diff --git a/cypress/e2e/Filtres/PageVariants_1.cy.ts b/cypress/e2e/Filtres/PageVariants_1.cy.ts new file mode 100644 index 00000000..333b5ee3 --- /dev/null +++ b/cypress/e2e/Filtres/PageVariants_1.cy.ts @@ -0,0 +1,24 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.deleteFilterIfExists('Cypress_F0'); +}); + +describe('Page des variants - Filtres', () => { + it('Créer un nouveau filtre', () => { + cy.saveFilterAs('Cypress_F0'); + + cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Cypress_F0$/).should('exist'); + cy.validateSelectedFilterInDropdown('Cypress_F0'); + cy.validateFilterInManager('Cypress_F0', 'exist'); + cy.validateIconStates('plus', false/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('copy', false/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('delete', false/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('share-alt', false/*isDisable*/, false/*isDirty*/); + }); +}); diff --git a/cypress/e2e/Filtres/PageVariants.cy.ts b/cypress/e2e/Filtres/PageVariants_2.cy.ts similarity index 60% rename from cypress/e2e/Filtres/PageVariants.cy.ts rename to cypress/e2e/Filtres/PageVariants_2.cy.ts index 22b2e16f..29fdb158 100644 --- a/cypress/e2e/Filtres/PageVariants.cy.ts +++ b/cypress/e2e/Filtres/PageVariants_2.cy.ts @@ -5,34 +5,12 @@ beforeEach(() => { cy.login(); cy.visitVariantsPage(); cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.deleteFilterIfExists('Cypress_Fedit1'); + cy.deleteFilterIfExists('Cypress_F1 COPY'); + cy.createFilterIfNotExists('Cypress_F1'); }); describe('Page des variants - Filtres', () => { - beforeEach(() => { - cy.deleteFilterIfExists('Cypress_F0'); - }); - - it('Créer un nouveau filtre', () => { - cy.saveFilterAs('Cypress_F0'); - - cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Cypress_F0$/).should('exist'); - cy.validateSelectedFilterInDropdown('Cypress_F0'); - cy.validateFilterInManager('Cypress_F0', 'exist'); - cy.validateIconStates('plus', false/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('copy', false/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('delete', false/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('share-alt', false/*isDisable*/, false/*isDirty*/); - }); -}); - -describe('Page des variants - Filtres', () => { - beforeEach(() => { - cy.deleteFilterIfExists('Cypress_Fedit1'); - cy.deleteFilterIfExists('Cypress_F1 COPY'); - cy.createFilterIfNotExists('Cypress_F1'); - }); - it('Sélectionner un filtre dans la dropdown', () => { cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F1').clickAndWait({force: true}); @@ -108,48 +86,4 @@ describe('Page des variants - Filtres', () => { cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); }); - - // Ne fonctionne pas, le popup "Copy to clipboard: ⌘+C, Enter" s'affiche et bloque le test - it.skip('Copier l\'url d\'un filtre', () => { - cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); - cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F1').clickAndWait({force: true}); - cy.get('[id="query-builder-header-tools"] [data-icon="share-alt"]').clickAndWait({force: true}); - // TODO: Récupérer l'rul copié et la valider - }); -}); - -describe('Page des variants - Filtres', () => { - beforeEach(() => { - cy.createFilterIfNotExists('Cypress_F2'); - }); - - it('Supprimer un filtre par la querybar', () => { - cy.deleteFilter('Cypress_F2'); - - cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Untitled Filter$/).should('exist'); - cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); - cy.validateFilterInManager('Cypress_F2', 'not.exist'); - cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); - }); - - it('Supprimer un filtre par le manager', () => { - cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); - cy.get('[data-menu-id*="manage-my-filters"]').clickAndWait({force: true}); - cy.get('[class="ant-modal-content"]').contains('Cypress_F2').parentsUntil('li[class*="ListItemWithActions"]').parent().find('[data-icon="delete"]').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'POST', '**/graphql', 1); - cy.get('button[class="ant-modal-close"]').invoke('click'); - - cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains('Cypress_F2').should('not.exist'); - cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); - cy.validateFilterInManager('Cypress_F2', 'not.exist'); - cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); - cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); - }); }); diff --git a/cypress/e2e/Filtres/PageVariants_3.cy.ts b/cypress/e2e/Filtres/PageVariants_3.cy.ts new file mode 100644 index 00000000..c61c44c9 --- /dev/null +++ b/cypress/e2e/Filtres/PageVariants_3.cy.ts @@ -0,0 +1,41 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitVariantsPage(); + cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.createFilterIfNotExists('Cypress_F2'); +}); + +describe('Page des variants - Filtres', () => { + it('Supprimer un filtre par la querybar', () => { + cy.deleteFilter('Cypress_F2'); + + cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains(/^Untitled Filter$/).should('exist'); + cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); + cy.validateFilterInManager('Cypress_F2', 'not.exist'); + cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); + }); + + it('Supprimer un filtre par le manager', () => { + cy.get('button[class*="QueryBuilderHeaderTools_queryBuilderHeaderDdb"]').clickAndWait({force: true}); + cy.get('[data-menu-id*="manage-my-filters"]').clickAndWait({force: true}); + cy.get('[class="ant-modal-content"]').contains('Cypress_F2').parentsUntil('li[class*="ListItemWithActions"]').parent().find('[data-icon="delete"]').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'POST', '**/graphql', 1); + cy.get('button[class="ant-modal-close"]').invoke('click'); + + cy.get('[id="query-builder-header-tools"] [class*="Header_togglerTitle"]').contains('Cypress_F2').should('not.exist'); + cy.get('[class*="ant-dropdown-menu-item"]').contains('Cypress_F2').should('not.exist'); + cy.validateFilterInManager('Cypress_F2', 'not.exist'); + cy.validateIconStates('plus', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('save', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('copy', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('delete', true/*isDisable*/, false/*isDirty*/); + cy.validateIconStates('share-alt', true/*isDisable*/, false/*isDirty*/); + }); +}); diff --git a/cypress/e2e/ManifestButton/Dataset.cy.ts b/cypress/e2e/ManifestButton/Dataset_1.cy.ts similarity index 75% rename from cypress/e2e/ManifestButton/Dataset.cy.ts rename to cypress/e2e/ManifestButton/Dataset_1.cy.ts index 2092a15f..dd888d94 100644 --- a/cypress/e2e/ManifestButton/Dataset.cy.ts +++ b/cypress/e2e/ManifestButton/Dataset_1.cy.ts @@ -9,19 +9,15 @@ beforeEach(() => { cy.login(); cy.visitStudyEntity('HTP', 1); - cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { if ($el.text().includes('HTP WGS (2021 X01)')) { cy.wrap($el).as('datasetPanel'); } }); + cy.get('@datasetPanel').find('[class="ant-collapse-header"] button[class*="ant-btn-default "]').eq(1).click({force: true}); }); describe('Dataset d\'une étude - Bouton Manifest', {retries: {runMode: 0}}, () => { - beforeEach(() => { - cy.get('@datasetPanel').find('[class="ant-collapse-header"] button[class*="ant-btn-default "]').eq(1).click({force: true}); - }); - it('Vérifier les informations affichées - Modal', () => { cy.get('[class="ant-modal-title"]').contains('File manifest').should('exist'); cy.get('[class="ant-modal-body"]').contains('Download a manifest of the selected files which can be used for bulk downloading using Cavatica’s ').should('exist'); @@ -68,35 +64,3 @@ describe('Dataset d\'une étude - Bouton Manifest', {retries: {runMode: 0}}, () cy.validateFileName('*.tsv'); }); }); - -describe('Dataset Unharmonized d\'une étude - Bouton Manifest', () => { - it('Vérifier les informations affichées - Modal', () => { - cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { - if ($el.text().includes('HTP Mass Cytometry (2020)')) { - cy.wrap($el).as('datasetPanel'); - } - }); - - cy.get('@datasetPanel').find('[class="ant-collapse-header"]').contains('Manifest').should('not.exist'); - }); -}); - -describe('Dataset d\'une étude - Télécharger le manifest', {retries: {runMode: 0}}, () => { - beforeEach(() => { - cy.get('@datasetPanel').find('[class="ant-collapse-header"] button[class*="ant-btn-default "]').eq(1).click({force: true}); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include_HTP-WGS-2021-X01_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('DownloadManifestDataset.json'); - }); - - it('Valider le contenu du fichier [SJIP-967]', () => { - cy.validateFileContent('DownloadManifestDataset.json'); - }); -}); diff --git a/cypress/e2e/ManifestButton/Dataset_2.cy.ts b/cypress/e2e/ManifestButton/Dataset_2.cy.ts new file mode 100644 index 00000000..d0fdb7b7 --- /dev/null +++ b/cypress/e2e/ManifestButton/Dataset_2.cy.ts @@ -0,0 +1,29 @@ +/// +import '../../support/commands'; +import { getDateTime } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitStudyEntity('HTP', 1); + cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { + if ($el.text().includes('HTP WGS (2021 X01)')) { + cy.wrap($el).as('datasetPanel'); + } + }); +}); + +describe('Dataset Unharmonized d\'une étude - Bouton Manifest', () => { + it('Vérifier les informations affichées - Modal', () => { + cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { + if ($el.text().includes('HTP Mass Cytometry (2020)')) { + cy.wrap($el).as('datasetPanel'); + } + }); + + cy.get('@datasetPanel').find('[class="ant-collapse-header"]').contains('Manifest').should('not.exist'); + }); +}); diff --git a/cypress/e2e/ManifestButton/Dataset_3.cy.ts b/cypress/e2e/ManifestButton/Dataset_3.cy.ts new file mode 100644 index 00000000..9cb79b8e --- /dev/null +++ b/cypress/e2e/ManifestButton/Dataset_3.cy.ts @@ -0,0 +1,34 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitStudyEntity('HTP', 1); + cy.get('[class*="EntityDataset_panel"]').each(($el: JQuery) => { + if ($el.text().includes('HTP WGS (2021 X01)')) { + cy.wrap($el).as('datasetPanel'); + } + }); + cy.get('@datasetPanel').find('[class="ant-collapse-header"] button[class*="ant-btn-default "]').eq(1).click({force: true}); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Dataset d\'une étude - Télécharger le manifest', {retries: {runMode: 0}}, () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include_HTP-WGS-2021-X01_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('DownloadManifestDataset.json'); + }); + + it('Valider le contenu du fichier [SJIP-967]', () => { + cy.validateFileContent('DownloadManifestDataset.json'); + }); +}); diff --git a/cypress/e2e/ManifestButton/PageDataExploration.cy.ts b/cypress/e2e/ManifestButton/PageDataExploration_1.cy.ts similarity index 66% rename from cypress/e2e/ManifestButton/PageDataExploration.cy.ts rename to cypress/e2e/ManifestButton/PageDataExploration_1.cy.ts index 01e0b1e7..b2af88ca 100644 --- a/cypress/e2e/ManifestButton/PageDataExploration.cy.ts +++ b/cypress/e2e/ManifestButton/PageDataExploration_1.cy.ts @@ -10,13 +10,10 @@ beforeEach(() => { cy.login(); cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[class*="Header_ProTableHeader"] button[class*="ant-btn-default"]').eq(1).click({force: true}); }); describe('Page Data Exploration (Data Files) - Bouton Manifest', () => { - beforeEach(() => { - cy.get('[class*="Header_ProTableHeader"] button[class*="ant-btn-default"]').eq(1).click({force: true}); - }); - it('Vérifier les informations affichées - Modal', () => { cy.get('[class="ant-modal-title"]').contains('File manifest').should('exist'); cy.get('[class="ant-modal-body"]').contains('Download a manifest of the selected files which can be used for bulk downloading using Cavatica’s ').should('exist'); @@ -56,44 +53,3 @@ describe('Page Data Exploration (Data Files) - Bouton Manifest', () => { cy.validateFileName('*.tsv'); }); }); - -describe('Page Data Exploration (Data Files) - Télécharger le manifest', () => { - beforeEach(() => { - cy.get('[class*="Header_ProTableHeader"] button[class*="ant-btn-default"]').eq(1).click({force: true}); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('DownloadManifest.json'); - }); - - it('Valider le contenu du fichier [SJIP-967]', () => { - cy.validateFileContent('DownloadManifest.json'); - }); -}); - -describe('Page Data Exploration (Data Files) - Télécharger le manifest (checkbox)', () => { - beforeEach(() => { - cy.get('[class*="Header_ProTableHeader"] button[class*="ant-btn-default"]').eq(1).click({force: true}); - cy.get('[class="ant-modal-body"] input[type="checkbox"]').check({force: true}); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include_familyManifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('DownloadManifestFamily.json'); - }); - - it('Valider le contenu du fichier [SJIP-967]', () => { - cy.validateFileContent('DownloadManifestFamily.json'); - }); -}); diff --git a/cypress/e2e/ManifestButton/PageDataExploration_2.cy.ts b/cypress/e2e/ManifestButton/PageDataExploration_2.cy.ts new file mode 100644 index 00000000..babd9c0c --- /dev/null +++ b/cypress/e2e/ManifestButton/PageDataExploration_2.cy.ts @@ -0,0 +1,30 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[class*="Header_ProTableHeader"] button[class*="ant-btn-default"]').eq(1).click({force: true}); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page Data Exploration (Data Files) - Télécharger le manifest', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('DownloadManifest.json'); + }); + + it('Valider le contenu du fichier [SJIP-967]', () => { + cy.validateFileContent('DownloadManifest.json'); + }); +}); diff --git a/cypress/e2e/ManifestButton/PageDataExploration_3.cy.ts b/cypress/e2e/ManifestButton/PageDataExploration_3.cy.ts new file mode 100644 index 00000000..a3018269 --- /dev/null +++ b/cypress/e2e/ManifestButton/PageDataExploration_3.cy.ts @@ -0,0 +1,31 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitDataExploration('datafiles', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[class*="Header_ProTableHeader"] button[class*="ant-btn-default"]').eq(1).click({force: true}); + cy.get('[class="ant-modal-body"] input[type="checkbox"]').check({force: true}); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page Data Exploration (Data Files) - Télécharger le manifest (checkbox)', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include_familyManifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('DownloadManifestFamily.json'); + }); + + it('Valider le contenu du fichier [SJIP-967]', () => { + cy.validateFileContent('DownloadManifestFamily.json'); + }); +}); diff --git a/cypress/e2e/ManifestButton/PageFile.cy.ts b/cypress/e2e/ManifestButton/PageFile_1.cy.ts similarity index 66% rename from cypress/e2e/ManifestButton/PageFile.cy.ts rename to cypress/e2e/ManifestButton/PageFile_1.cy.ts index 46e63e01..144f8835 100644 --- a/cypress/e2e/ManifestButton/PageFile.cy.ts +++ b/cypress/e2e/ManifestButton/PageFile_1.cy.ts @@ -9,13 +9,10 @@ beforeEach(() => { cy.login(); cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.arriba.fusions.pdf'); + cy.get('[class*="EntityTitle"] button[class*="ant-btn-default"]').click({force: true}); }); describe('Page d\'un fichier - Bouton Manifest', () => { - beforeEach(() => { - cy.get('[class*="EntityTitle"] button[class*="ant-btn-default"]').click({force: true}); - }); - it('Vérifier les informations affichées - Modal', () => { cy.get('[class="ant-modal-title"]').contains('File manifest').should('exist'); cy.get('[class="ant-modal-body"]').contains('Download a manifest of the selected files which can be used for bulk downloading using Cavatica’s ').should('exist'); @@ -54,44 +51,3 @@ describe('Page d\'un fichier - Bouton Manifest', () => { cy.validateFileName('*.tsv'); }); }); - -describe('Page d\'un fichier - Télécharger le manifest', () => { - beforeEach(() => { - cy.get('[class*="EntityTitle"] button[class*="ant-btn-default"]').click({force: true}); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('DownloadManifest.json'); - }); - - it('Valider le contenu du fichier [SJIP-967]', () => { - cy.validateFileContent('DownloadManifest.json'); - }); -}); - -describe('Page d\'un fichier - Télécharger le manifest (checkbox)', () => { - beforeEach(() => { - cy.get('[class*="EntityTitle"] button[class*="ant-btn-default"]').click({force: true}); - cy.get('[class="ant-modal-body"] input[type="checkbox"]').check({force: true}); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include_familyManifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('DownloadManifestFamily.json'); - }); - - it('Valider le contenu du fichier [SJIP-967]', () => { - cy.validateFileContent('DownloadManifestFamily.json'); - }); -}); diff --git a/cypress/e2e/ManifestButton/PageFile_2.cy.ts b/cypress/e2e/ManifestButton/PageFile_2.cy.ts new file mode 100644 index 00000000..9bcd54e5 --- /dev/null +++ b/cypress/e2e/ManifestButton/PageFile_2.cy.ts @@ -0,0 +1,29 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.arriba.fusions.pdf'); + cy.get('[class*="EntityTitle"] button[class*="ant-btn-default"]').click({force: true}); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un fichier - Télécharger le manifest', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('DownloadManifest.json'); + }); + + it('Valider le contenu du fichier [SJIP-967]', () => { + cy.validateFileContent('DownloadManifest.json'); + }); +}); diff --git a/cypress/e2e/ManifestButton/PageFile_3.cy.ts b/cypress/e2e/ManifestButton/PageFile_3.cy.ts new file mode 100644 index 00000000..65897e7a --- /dev/null +++ b/cypress/e2e/ManifestButton/PageFile_3.cy.ts @@ -0,0 +1,30 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitFileEntity('HTP.ce770763-b904-4c66-8b08-c54dd4e7c7b5.arriba.fusions.pdf'); + cy.get('[class*="EntityTitle"] button[class*="ant-btn-default"]').click({force: true}); + cy.get('[class="ant-modal-body"] input[type="checkbox"]').check({force: true}); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un fichier - Télécharger le manifest (checkbox)', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include_familyManifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('DownloadManifestFamily.json'); + }); + + it('Valider le contenu du fichier [SJIP-967]', () => { + cy.validateFileContent('DownloadManifestFamily.json'); + }); +}); diff --git a/cypress/e2e/ManifestButton/PageStudy.cy.ts b/cypress/e2e/ManifestButton/PageStudy_1.cy.ts similarity index 82% rename from cypress/e2e/ManifestButton/PageStudy.cy.ts rename to cypress/e2e/ManifestButton/PageStudy_1.cy.ts index 427f81da..8a9f189e 100644 --- a/cypress/e2e/ManifestButton/PageStudy.cy.ts +++ b/cypress/e2e/ManifestButton/PageStudy_1.cy.ts @@ -9,13 +9,10 @@ beforeEach(() => { cy.login(); cy.visitStudyEntity('DS-NEXUS', 1); + cy.get('[class*="EntityTitleLogo"] button[class*="ant-btn-primary"]').click({force: true}); }); describe('Page d\'une étude - Bouton Manifest', {retries: {runMode: 0}}, () => { - beforeEach(() => { - cy.get('[class*="EntityTitleLogo"] button[class*="ant-btn-primary"]').click({force: true}); - }); - it('Vérifier les informations affichées - Modal', () => { cy.get('[class="ant-modal-title"]').contains('File manifest').should('exist'); cy.get('[class="ant-modal-body"]').contains('Download a manifest of the selected files which can be used for bulk downloading using Cavatica’s ').should('exist'); @@ -62,23 +59,3 @@ describe('Page d\'une étude - Bouton Manifest', {retries: {runMode: 0}}, () => cy.validateFileName('*.tsv'); }); }); - -describe('Page d\'une étude - Télécharger le manifest', {retries: {runMode: 0}}, () => { - beforeEach(() => { - cy.get('[class*="EntityTitleLogo"] button[class*="ant-btn-primary"]').click({force: true}); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('DownloadManifestStudy.json'); - }); - - it('Valider le contenu du fichier [SJIP-967]', () => { - cy.validateFileContent('DownloadManifestStudy.json'); - }); -}); diff --git a/cypress/e2e/ManifestButton/PageStudy_2.cy.ts b/cypress/e2e/ManifestButton/PageStudy_2.cy.ts new file mode 100644 index 00000000..1b944366 --- /dev/null +++ b/cypress/e2e/ManifestButton/PageStudy_2.cy.ts @@ -0,0 +1,29 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitStudyEntity('DS-NEXUS', 1); + cy.get('[class*="EntityTitleLogo"] button[class*="ant-btn-primary"]').click({force: true}); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'une étude - Télécharger le manifest', {retries: {runMode: 0}}, () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include_manifest_'+`${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}`+'T*.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('DownloadManifestStudy.json'); + }); + + it('Valider le contenu du fichier [SJIP-967]', () => { + cy.validateFileContent('DownloadManifestStudy.json'); + }); +}); diff --git a/cypress/e2e/Recherche/PageStudies.cy.ts b/cypress/e2e/Recherche/PageStudies.cy.ts index f0baa6bc..90846355 100644 --- a/cypress/e2e/Recherche/PageStudies.cy.ts +++ b/cypress/e2e/Recherche/PageStudies.cy.ts @@ -1,6 +1,5 @@ /// import '../../support/commands'; -import { oneMinute } from '../../support/utils'; beforeEach(() => { cy.login(); diff --git a/cypress/e2e/Requetes/ActionsSur0Requete.cy.ts b/cypress/e2e/Requetes/ActionsSur0Requete.cy.ts index 7bf44a10..1766f283 100644 --- a/cypress/e2e/Requetes/ActionsSur0Requete.cy.ts +++ b/cypress/e2e/Requetes/ActionsSur0Requete.cy.ts @@ -3,18 +3,14 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=b1f9898e-d050-492e-b1fd-7055ad8d9f8e'); + + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); }); describe('Page Data Exploration - Requêtes', () => { - - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=b1f9898e-d050-492e-b1fd-7055ad8d9f8e'); - - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); // data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); // data-cy="ExpandAll" - }); - it('Construire une première requête', () => { cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); cy.validateTotalSelectedQuery(/\d{1}/); diff --git a/cypress/e2e/Requetes/ActionsSur1Requete1Pilule.cy.ts b/cypress/e2e/Requetes/ActionsSur1Requete1Pilule.cy.ts index 5635e8e9..b3575ccf 100644 --- a/cypress/e2e/Requetes/ActionsSur1Requete1Pilule.cy.ts +++ b/cypress/e2e/Requetes/ActionsSur1Requete1Pilule.cy.ts @@ -3,18 +3,14 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=486a60b5-d2f7-4c76-a19b-463aaa65b9cb'); + + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); }); describe('Page Data Exploration - Requêtes', () => { - - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=486a60b5-d2f7-4c76-a19b-463aaa65b9cb'); - - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); // data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); // data-cy="ExpandAll" - }); - it('Éditer une pilule via la facette', () => { cy.checkValueFacetAndApply('Sample Type', 'RNA'); diff --git a/cypress/e2e/Requetes/ActionsSur1Requete2Pilules.cy.ts b/cypress/e2e/Requetes/ActionsSur1Requete2Pilules.cy.ts index 92750fd0..dce43619 100644 --- a/cypress/e2e/Requetes/ActionsSur1Requete2Pilules.cy.ts +++ b/cypress/e2e/Requetes/ActionsSur1Requete2Pilules.cy.ts @@ -3,18 +3,14 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=11165f81-edb0-4b99-9b71-690ba67aa812'); + + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); }); describe('Page Data Exploration - Requêtes', () => { - - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=11165f81-edb0-4b99-9b71-690ba67aa812'); - - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); // data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); // data-cy="ExpandAll" - }); - it('Modifier l\'opérateur d\'une requête', () => { cy.intercept('POST', '**/graphql').as('getPOSTgraphql1'); cy.get('[class*="QueryBar_selected"] [class*="Combiner_operator"]').clickAndWait({force: true}); diff --git a/cypress/e2e/Requetes/ActionsSur2Requetes.cy.ts b/cypress/e2e/Requetes/ActionsSur2Requetes.cy.ts index a39d252b..63bf4744 100644 --- a/cypress/e2e/Requetes/ActionsSur2Requetes.cy.ts +++ b/cypress/e2e/Requetes/ActionsSur2Requetes.cy.ts @@ -3,18 +3,14 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=443bca8e-4f39-4743-995f-aea57497450c'); + + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); }); describe('Page Data Exploration - Requêtes', () => { - - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=443bca8e-4f39-4743-995f-aea57497450c'); - - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); // data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); // data-cy="ExpandAll" - }); - it('Sélectionner une requête', () => { cy.validateTableResultsCount(/\d{1}/); diff --git a/cypress/e2e/Requetes/ActionsSurCombinaison.cy.ts b/cypress/e2e/Requetes/ActionsSurCombinaison.cy.ts index eae22a55..d9b266d3 100644 --- a/cypress/e2e/Requetes/ActionsSurCombinaison.cy.ts +++ b/cypress/e2e/Requetes/ActionsSurCombinaison.cy.ts @@ -3,18 +3,14 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=af3a1a65-c7f4-453d-9909-4bbc3827a393'); + + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); + cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); }); describe('Page Data Exploration - Requêtes', () => { - - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=af3a1a65-c7f4-453d-9909-4bbc3827a393'); - - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').clickAndWait({force: true}); // data-cy="ExpandAll" - cy.get('[class*="Filters_filterExpandBtnWrapper"] button').contains('Collapse all').should('exist'); // data-cy="ExpandAll" - }); - it('Supprimer une requête utilisée dans une combinaison', () => { cy.intercept('POST', '**/graphql').as('getPOSTgraphql1'); cy.get('.simplebar-wrapper').invoke('css', 'overflow', 'visible'); diff --git a/cypress/e2e/Requetes/ValidationParticipants.cy.ts b/cypress/e2e/Requetes/ValidationParticipants.cy.ts index b617ce4d..13607ca5 100644 --- a/cypress/e2e/Requetes/ValidationParticipants.cy.ts +++ b/cypress/e2e/Requetes/ValidationParticipants.cy.ts @@ -3,19 +3,10 @@ import '../../support/commands'; beforeEach(() => { cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=779220be-ef0a-420c-8aa8-1ad83f489165'); }); describe('Page Data Exploration - Requêtes', () => { - - beforeEach(() => { - cy.visitDataExploration('participants', '?sharedFilterId=779220be-ef0a-420c-8aa8-1ad83f489165'); - }); - - it.skip('Validation Facette numérique ou No Data', () => { - cy.validateTotalSelectedQuery(/(1,965|1,985|1,989|2,141)/); - cy.validateTableResultsCount(/(1,965|1,985|1,989|2,141)/); - }); - it('Validation Facette numérique OU Facette standard', () => { cy.intercept('POST', '**/graphql').as('getPOSTgraphql'); cy.get('.simplebar-wrapper').invoke('css', 'overflow', 'visible'); @@ -26,16 +17,6 @@ describe('Page Data Exploration - Requêtes', () => { cy.validateTableResultsCount('4,738'); }); - it.skip('Validation Facette numérique ou No Data ET Facette standard', () => { - cy.intercept('POST', '**/graphql').as('getPOSTgraphql'); - cy.get('.simplebar-wrapper').invoke('css', 'overflow', 'visible'); - cy.get('[class*="QueryBar_queryBarWrapper"]').eq(2).clickAndWait(); - cy.wait('@getPOSTgraphql'); - - cy.validateTotalSelectedQuery(/(1,911|1,933|1,935|2,082)/); - cy.validateTableResultsCount(/(1,911|1,933|1,935|2,082)/); - }); - it('Validation Facette standard (Any of)', () => { cy.intercept('POST', '**/graphql').as('getPOSTgraphql'); cy.get('.simplebar-wrapper').invoke('css', 'overflow', 'visible'); diff --git a/cypress/e2e/SaveSetButton/PageDataExploration.cy.ts b/cypress/e2e/SaveSetButton/PageDataExploration.cy.ts deleted file mode 100644 index 15664ca2..00000000 --- a/cypress/e2e/SaveSetButton/PageDataExploration.cy.ts +++ /dev/null @@ -1,248 +0,0 @@ -/// -import '../../support/commands'; - -describe('Page Data Exploration (Participants) - Bouton Save set', () => { - - beforeEach(() => { - cy.login(); - cy.deleteSetIfExists('participants', 'Cypress_New_P'); - cy.deleteSetIfExists('participants', 'Cypress_P'); - cy.visitDataExploration('participants'); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - cy.createSetIfNotExists('Cypress_P', 0); - cy.visitDataExploration('participants'); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - }); - - it('Vérifier les informations affichées - Titre de la dropdown', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id="participant-set-dropdown-container"] button').clickAndWait({force: true}); - - cy.get('[class="ant-dropdown-menu-title-content"]').contains('1 participant selected').should('exist'); - }); - - it('Vérifier les informations affichées - Tooltip de la dropdown', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id="participant-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[class="ant-dropdown-menu-title-content"] [data-icon="info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - - cy.get('[class="ant-tooltip-inner"]').should('not.have.class', 'ant-tooltip-hidden'); - cy.get('[class="ant-tooltip-inner"]').contains('Max. 10,000 items at a time. The first 10,000 will be processed.').should('exist'); - }); - - it('Valider les fonctionnalités du bouton - Save as new set', () => { - cy.saveSetAs('Cypress_New_P', 0); - - cy.get('[class*="ant-notification"]').contains('Your set has been saved.').should('exist'); - cy.get('[class*="ant-notification"]').contains('You can add your sets to a query from the sidebar or the dashboard.').should('exist'); - - cy.get('[class*="SetSearch_search"] input').type('Cypress_New_P', {force: true}); - cy.get('[class*="SetSearch_search"] [class*="ant-select-dropdown"]').contains('Cypress_New_P').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="participants"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_New_P').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^1$/).clickAndWait({force: true}); - }); - - it('Valider les fonctionnalités du bouton - Add to existing set', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(1).find('[type="checkbox"]').check({force: true}); - cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[data-menu-id*="add_ids"]').clickAndWait({force: true}); - - cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); - cy.get('form[id="add-remove-set"]').should('not.exist'); - - cy.get('[class*="ant-notification"]').contains('Success').should('exist'); - cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="participants"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_P').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^2$/).clickAndWait({force: true}); - }); - - it('Valider les fonctionnalités du bouton - Remove from existing set', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[data-menu-id*="remove_ids"]').clickAndWait({force: true}); - - cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); - cy.get('form[id="add-remove-set"]').should('not.exist'); - - cy.get('[class*="ant-notification"]').contains('Success').should('exist'); - cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="participants"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_P').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^0$/).clickAndWait({force: true}); - }); -}); - -describe('Page Data Exploration (Biospecimens) - Bouton Save set', () => { - - beforeEach(() => { - cy.login(); - cy.deleteSetIfExists('biospecimen', 'Cypress_New_B'); - cy.deleteSetIfExists('biospecimen', 'Cypress_B'); - cy.visitDataExploration('biospecimens'); - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.createSetIfNotExists('Cypress_B', 0); - cy.visitDataExploration('biospecimens'); - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - }); - - it('Vérifier les informations affichées - Titre de la dropdown', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id="biospecimen-set-dropdown-container"] button').clickAndWait({force: true}); - - cy.get('[class="ant-dropdown-menu-title-content"]').contains('1 biospecimen selected').should('exist'); - }); - - it('Vérifier les informations affichées - Tooltip de la dropdown', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id="biospecimen-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[class="ant-dropdown-menu-title-content"] [data-icon="info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - - cy.get('[class="ant-tooltip-inner"]').should('not.have.class', 'ant-tooltip-hidden'); - cy.get('[class="ant-tooltip-inner"]').contains('Max. 10,000 items at a time. The first 10,000 will be processed.').should('exist'); - }); - - it('Valider les fonctionnalités du bouton - Save as new set', () => { - cy.saveSetAs('Cypress_New_B', 0); - - cy.get('[class*="ant-notification"]').contains('Your set has been saved.').should('exist'); - cy.get('[class*="ant-notification"]').contains('You can add your sets to a query from the sidebar or the dashboard.').should('exist'); - - cy.get('[class*="SetSearch_search"] input').type('Cypress_New_B', {force: true}); - cy.get('[class*="SetSearch_search"] [class*="ant-select-dropdown"]').contains('Cypress_New_B').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_New_B').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^1$/).clickAndWait({force: true}); - }); - - it('Valider les fonctionnalités du bouton - Add to existing set', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(1).find('[type="checkbox"]').check({force: true}); - cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[data-menu-id*="add_ids"]').clickAndWait({force: true}); - - cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); - cy.get('form[id="add-remove-set"]').should('not.exist'); - - cy.get('[class*="ant-notification"]').contains('Success').should('exist'); - cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_B').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^2$/).clickAndWait({force: true}); - }); - - it('Valider les fonctionnalités du bouton - Remove from existing set', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[data-menu-id*="remove_ids"]').clickAndWait({force: true}); - - cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); - cy.get('form[id="add-remove-set"]').should('not.exist'); - - cy.get('[class*="ant-notification"]').contains('Success').should('exist'); - cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_B').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^0$/).clickAndWait({force: true}); - }); -}); - -describe('Page Data Exploration (Data Files) - Bouton Save set', () => { - - beforeEach(() => { - cy.login(); - cy.deleteSetIfExists('files', 'Cypress_New_F'); - cy.deleteSetIfExists('files', 'Cypress_F'); - cy.visitDataExploration('datafiles'); - cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); - cy.createSetIfNotExists('Cypress_F', 0); - cy.visitDataExploration('datafiles'); - cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); - }); - - it('Vérifier les informations affichées - Titre de la dropdown', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id="file-set-dropdown-container"] button').clickAndWait({force: true}); - - cy.get('[class="ant-dropdown-menu-title-content"]').contains('1 file selected').should('exist'); - }); - - it('Vérifier les informations affichées - Tooltip de la dropdown', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id="file-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[class="ant-dropdown-menu-title-content"] [data-icon="info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - - cy.get('[class="ant-tooltip-inner"]').should('not.have.class', 'ant-tooltip-hidden'); - cy.get('[class="ant-tooltip-inner"]').contains('Max. 10,000 items at a time. The first 10,000 will be processed.').should('exist'); - }); - - it('Valider les fonctionnalités du bouton - Save as new set', () => { - cy.saveSetAs('Cypress_New_F', 0); - - cy.get('[class*="ant-notification"]').contains('Your set has been saved.').should('exist'); - cy.get('[class*="ant-notification"]').contains('You can add your sets to a query from the sidebar or the dashboard.').should('exist'); - - cy.get('[class*="SetSearch_search"] input').type('Cypress_New_F', {force: true}); - cy.get('[class*="SetSearch_search"] [class*="ant-select-dropdown"]').contains('Cypress_New_F').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_New_F').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^1$/).clickAndWait({force: true}); - }); - - it('Valider les fonctionnalités du bouton - Add to existing set', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(1).find('[type="checkbox"]').check({force: true}); - cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[data-menu-id*="add_ids"]').clickAndWait({force: true}); - - cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); - cy.get('form[id="add-remove-set"]').should('not.exist'); - - cy.get('[class*="ant-notification"]').contains('Success').should('exist'); - cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_F').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^2$/).clickAndWait({force: true}); - }); - - it('Valider les fonctionnalités du bouton - Remove from existing set', () => { - cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); - cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); - cy.get('[data-menu-id*="remove_ids"]').clickAndWait({force: true}); - - cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); - cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').clickAndWait({force: true}); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); - cy.get('form[id="add-remove-set"]').should('not.exist'); - - cy.get('[class*="ant-notification"]').contains('Success').should('exist'); - cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_F').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^0$/).clickAndWait({force: true}); - }); -}); diff --git a/cypress/e2e/SaveSetButton/PageDataExploration_1.cy.ts b/cypress/e2e/SaveSetButton/PageDataExploration_1.cy.ts new file mode 100644 index 00000000..f036db57 --- /dev/null +++ b/cypress/e2e/SaveSetButton/PageDataExploration_1.cy.ts @@ -0,0 +1,83 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.deleteSetIfExists('participants', 'Cypress_New_P'); + cy.deleteSetIfExists('participants', 'Cypress_P'); + cy.visitDataExploration('participants'); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); + cy.createSetIfNotExists('Cypress_P', 0); + cy.visitDataExploration('participants'); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); +}); + +describe('Page Data Exploration (Participants) - Bouton Save set', () => { + it('Vérifier les informations affichées - Titre de la dropdown', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id="participant-set-dropdown-container"] button').clickAndWait({force: true}); + + cy.get('[class="ant-dropdown-menu-title-content"]').contains('1 participant selected').should('exist'); + }); + + it('Vérifier les informations affichées - Tooltip de la dropdown', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id="participant-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[class="ant-dropdown-menu-title-content"] [data-icon="info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + + cy.get('[class="ant-tooltip-inner"]').should('not.have.class', 'ant-tooltip-hidden'); + cy.get('[class="ant-tooltip-inner"]').contains('Max. 10,000 items at a time. The first 10,000 will be processed.').should('exist'); + }); + + it('Valider les fonctionnalités du bouton - Save as new set', () => { + cy.saveSetAs('Cypress_New_P', 0); + + cy.get('[class*="ant-notification"]').contains('Your set has been saved.').should('exist'); + cy.get('[class*="ant-notification"]').contains('You can add your sets to a query from the sidebar or the dashboard.').should('exist'); + + cy.get('[class*="SetSearch_search"] input').type('Cypress_New_P', {force: true}); + cy.get('[class*="SetSearch_search"] [class*="ant-select-dropdown"]').contains('Cypress_New_P').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="participants"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_New_P').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^1$/).clickAndWait({force: true}); + }); + + it('Valider les fonctionnalités du bouton - Add to existing set', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(1).find('[type="checkbox"]').check({force: true}); + cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[data-menu-id*="add_ids"]').clickAndWait({force: true}); + + cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); + cy.get('form[id="add-remove-set"]').should('not.exist'); + + cy.get('[class*="ant-notification"]').contains('Success').should('exist'); + cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="participants"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_P').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^2$/).clickAndWait({force: true}); + }); + + it('Valider les fonctionnalités du bouton - Remove from existing set', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[data-menu-id*="remove_ids"]').clickAndWait({force: true}); + + cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_P').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); + cy.get('form[id="add-remove-set"]').should('not.exist'); + + cy.get('[class*="ant-notification"]').contains('Success').should('exist'); + cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="participants"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_P').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^0$/).clickAndWait({force: true}); + }); +}); diff --git a/cypress/e2e/SaveSetButton/PageDataExploration_2.cy.ts b/cypress/e2e/SaveSetButton/PageDataExploration_2.cy.ts new file mode 100644 index 00000000..4d8408a7 --- /dev/null +++ b/cypress/e2e/SaveSetButton/PageDataExploration_2.cy.ts @@ -0,0 +1,83 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.deleteSetIfExists('biospecimen', 'Cypress_New_B'); + cy.deleteSetIfExists('biospecimen', 'Cypress_B'); + cy.visitDataExploration('biospecimens'); + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.createSetIfNotExists('Cypress_B', 0); + cy.visitDataExploration('biospecimens'); + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); +}); + +describe('Page Data Exploration (Biospecimens) - Bouton Save set', () => { + it('Vérifier les informations affichées - Titre de la dropdown', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id="biospecimen-set-dropdown-container"] button').clickAndWait({force: true}); + + cy.get('[class="ant-dropdown-menu-title-content"]').contains('1 biospecimen selected').should('exist'); + }); + + it('Vérifier les informations affichées - Tooltip de la dropdown', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id="biospecimen-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[class="ant-dropdown-menu-title-content"] [data-icon="info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + + cy.get('[class="ant-tooltip-inner"]').should('not.have.class', 'ant-tooltip-hidden'); + cy.get('[class="ant-tooltip-inner"]').contains('Max. 10,000 items at a time. The first 10,000 will be processed.').should('exist'); + }); + + it('Valider les fonctionnalités du bouton - Save as new set', () => { + cy.saveSetAs('Cypress_New_B', 0); + + cy.get('[class*="ant-notification"]').contains('Your set has been saved.').should('exist'); + cy.get('[class*="ant-notification"]').contains('You can add your sets to a query from the sidebar or the dashboard.').should('exist'); + + cy.get('[class*="SetSearch_search"] input').type('Cypress_New_B', {force: true}); + cy.get('[class*="SetSearch_search"] [class*="ant-select-dropdown"]').contains('Cypress_New_B').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_New_B').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^1$/).clickAndWait({force: true}); + }); + + it('Valider les fonctionnalités du bouton - Add to existing set', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(1).find('[type="checkbox"]').check({force: true}); + cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[data-menu-id*="add_ids"]').clickAndWait({force: true}); + + cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); + cy.get('form[id="add-remove-set"]').should('not.exist'); + + cy.get('[class*="ant-notification"]').contains('Success').should('exist'); + cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_B').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^2$/).clickAndWait({force: true}); + }); + + it('Valider les fonctionnalités du bouton - Remove from existing set', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[data-menu-id*="remove_ids"]').clickAndWait({force: true}); + + cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_B').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); + cy.get('form[id="add-remove-set"]').should('not.exist'); + + cy.get('[class*="ant-notification"]').contains('Success').should('exist'); + cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_B').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^0$/).clickAndWait({force: true}); + }); +}); diff --git a/cypress/e2e/SaveSetButton/PageDataExploration_3.cy.ts b/cypress/e2e/SaveSetButton/PageDataExploration_3.cy.ts new file mode 100644 index 00000000..0c2f3b37 --- /dev/null +++ b/cypress/e2e/SaveSetButton/PageDataExploration_3.cy.ts @@ -0,0 +1,83 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.deleteSetIfExists('files', 'Cypress_New_F'); + cy.deleteSetIfExists('files', 'Cypress_F'); + cy.visitDataExploration('datafiles'); + cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); + cy.createSetIfNotExists('Cypress_F', 0); + cy.visitDataExploration('datafiles'); + cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); +}); + +describe('Page Data Exploration (Data Files) - Bouton Save set', () => { + it('Vérifier les informations affichées - Titre de la dropdown', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id="file-set-dropdown-container"] button').clickAndWait({force: true}); + + cy.get('[class="ant-dropdown-menu-title-content"]').contains('1 file selected').should('exist'); + }); + + it('Vérifier les informations affichées - Tooltip de la dropdown', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id="file-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[class="ant-dropdown-menu-title-content"] [data-icon="info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + + cy.get('[class="ant-tooltip-inner"]').should('not.have.class', 'ant-tooltip-hidden'); + cy.get('[class="ant-tooltip-inner"]').contains('Max. 10,000 items at a time. The first 10,000 will be processed.').should('exist'); + }); + + it('Valider les fonctionnalités du bouton - Save as new set', () => { + cy.saveSetAs('Cypress_New_F', 0); + + cy.get('[class*="ant-notification"]').contains('Your set has been saved.').should('exist'); + cy.get('[class*="ant-notification"]').contains('You can add your sets to a query from the sidebar or the dashboard.').should('exist'); + + cy.get('[class*="SetSearch_search"] input').type('Cypress_New_F', {force: true}); + cy.get('[class*="SetSearch_search"] [class*="ant-select-dropdown"]').contains('Cypress_New_F').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_New_F').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^1$/).clickAndWait({force: true}); + }); + + it('Valider les fonctionnalités du bouton - Add to existing set', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(1).find('[type="checkbox"]').check({force: true}); + cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[data-menu-id*="add_ids"]').clickAndWait({force: true}); + + cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); + cy.get('form[id="add-remove-set"]').should('not.exist'); + + cy.get('[class*="ant-notification"]').contains('Success').should('exist'); + cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_F').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^2$/).clickAndWait({force: true}); + }); + + it('Valider les fonctionnalités du bouton - Remove from existing set', () => { + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[id*="-set-dropdown-container"] button').clickAndWait({force: true}); + cy.get('[data-menu-id*="remove_ids"]').clickAndWait({force: true}); + + cy.get('[class*="ant-select-in-form-item"] input').focus().type('{enter}', {force: true}); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').parentsUntil('[class="ant-select-item-option-content"]').contains(/^1$/).should('exist'); + cy.get('[class*="ant-select-dropdown"]').contains('Cypress_F').clickAndWait({force: true}); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1); + cy.get('form[id="add-remove-set"]').should('not.exist'); + + cy.get('[class*="ant-notification"]').contains('Success').should('exist'); + cy.get('[class*="ant-notification"]').contains('Your set has been updated.').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"] [class*="ant-tabs-tabpane-active"]').contains('Cypress_F').parentsUntil('[class*="ListItem_savedSetListItem"]').parent().find('[class*="ListItem_count"]').contains(/^0$/).clickAndWait({force: true}); + }); +}); diff --git a/cypress/e2e/Telechargement/ClinicalDataPageParticipant_1.cy.ts b/cypress/e2e/Telechargement/ClinicalDataPageParticipant_1.cy.ts new file mode 100644 index 00000000..fb681473 --- /dev/null +++ b/cypress/e2e/Telechargement/ClinicalDataPageParticipant_1.cy.ts @@ -0,0 +1,25 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitParticipantEntity('pt-as0aepqm'); + cy.get('[class*="EntityTitle"] button[class*="ant-dropdown-trigger"]').click({force: true}); + cy.clickAndIntercept('[data-menu-id*="-clinicalData"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un participant - Télécharger le clinical data', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName(`include_clinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); + }); + + it('Valider le contenu du fichier [SJIP-1233]', () => { + cy.validateXlsxFileContent('DownloadClinicalData.json'); + }); +}); diff --git a/cypress/e2e/Telechargement/ClinicalDataPageParticipant.cy.ts b/cypress/e2e/Telechargement/ClinicalDataPageParticipant_2.cy.ts similarity index 53% rename from cypress/e2e/Telechargement/ClinicalDataPageParticipant.cy.ts rename to cypress/e2e/Telechargement/ClinicalDataPageParticipant_2.cy.ts index 7331b151..ece24d1d 100644 --- a/cypress/e2e/Telechargement/ClinicalDataPageParticipant.cy.ts +++ b/cypress/e2e/Telechargement/ClinicalDataPageParticipant_2.cy.ts @@ -10,29 +10,11 @@ beforeEach(() => { cy.login(); cy.visitParticipantEntity('pt-as0aepqm'); cy.get('[class*="EntityTitle"] button[class*="ant-dropdown-trigger"]').click({force: true}); -}); - -describe('Page d\'un participant - Télécharger le clinical data', () => { - beforeEach(() => { - cy.clickAndIntercept('[data-menu-id*="-clinicalData"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName(`include_clinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); - }); - - it('Valider le contenu du fichier [SJIP-1233]', () => { - cy.validateXlsxFileContent('DownloadClinicalData.json'); - }); + cy.clickAndIntercept('[data-menu-id*="-familyClinicalData"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); }); describe('Page d\'un participant - Télécharger le clinical data (family)', () => { - beforeEach(() => { - cy.clickAndIntercept('[data-menu-id*="-familyClinicalData"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - it('Valider le nom du fichier', () => { cy.validateFileName(`include_familyClinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); }); diff --git a/cypress/e2e/Telechargement/ClinicalDataPageStudy_1.cy.ts b/cypress/e2e/Telechargement/ClinicalDataPageStudy_1.cy.ts new file mode 100644 index 00000000..ffcea168 --- /dev/null +++ b/cypress/e2e/Telechargement/ClinicalDataPageStudy_1.cy.ts @@ -0,0 +1,25 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitStudyEntity('DS-NEXUS', 1); + cy.get('[class*="EntityTitle"] button[class*="ant-dropdown-trigger"]').click({force: true}); + cy.clickAndIntercept('[data-menu-id*="-clinicalData"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'une étude - Télécharger le clinical data', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName(`include_clinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); + }); + + it('Valider le contenu du fichier', () => { + cy.validateXlsxFileContent('DownloadClinicalDataStudy.json'); + }); +}); diff --git a/cypress/e2e/Telechargement/ClinicalDataPageStudy.cy.ts b/cypress/e2e/Telechargement/ClinicalDataPageStudy_2.cy.ts similarity index 53% rename from cypress/e2e/Telechargement/ClinicalDataPageStudy.cy.ts rename to cypress/e2e/Telechargement/ClinicalDataPageStudy_2.cy.ts index 5144d39e..d94ea712 100644 --- a/cypress/e2e/Telechargement/ClinicalDataPageStudy.cy.ts +++ b/cypress/e2e/Telechargement/ClinicalDataPageStudy_2.cy.ts @@ -10,29 +10,11 @@ beforeEach(() => { cy.login(); cy.visitStudyEntity('DS-NEXUS', 1); cy.get('[class*="EntityTitle"] button[class*="ant-dropdown-trigger"]').click({force: true}); -}); - -describe('Page d\'une étude - Télécharger le clinical data', () => { - beforeEach(() => { - cy.clickAndIntercept('[data-menu-id*="-clinicalData"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName(`include_clinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); - }); - - it('Valider le contenu du fichier', () => { - cy.validateXlsxFileContent('DownloadClinicalDataStudy.json'); - }); + cy.clickAndIntercept('[data-menu-id*="-familyClinicalData"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); }); describe('Page d\'une étude - Télécharger le clinical data (family)', () => { - beforeEach(() => { - cy.clickAndIntercept('[data-menu-id*="-familyClinicalData"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - it('Valider le nom du fichier', () => { cy.validateFileName(`include_familyClinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); }); diff --git a/cypress/e2e/Telechargement/ClinicalDataTableauParticipants_1.cy.ts b/cypress/e2e/Telechargement/ClinicalDataTableauParticipants_1.cy.ts new file mode 100644 index 00000000..a1da0264 --- /dev/null +++ b/cypress/e2e/Telechargement/ClinicalDataTableauParticipants_1.cy.ts @@ -0,0 +1,26 @@ +/// +import '../../support/commands'; +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + + cy.login(); + cy.visitDataExploration('participants', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); + cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); + cy.get('[class*="Header_ProTableHeader"] button[class*="ant-dropdown-trigger"]').eq(1).click({force: true}); + cy.clickAndIntercept('[data-menu-id*="-clinicalData"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); +}); + +describe('Page Data Exploration (Participants) - Télécharger le clinical data', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName(`include_clinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); + }); + + it('Valider le contenu du fichier [SJIP-1233]', () => { + cy.validateXlsxFileContent('DownloadClinicalData.json'); + }); +}); diff --git a/cypress/e2e/Telechargement/ClinicalDataTableauParticipants.cy.ts b/cypress/e2e/Telechargement/ClinicalDataTableauParticipants_2.cy.ts similarity index 58% rename from cypress/e2e/Telechargement/ClinicalDataTableauParticipants.cy.ts rename to cypress/e2e/Telechargement/ClinicalDataTableauParticipants_2.cy.ts index ac0b89b7..59a4b904 100644 --- a/cypress/e2e/Telechargement/ClinicalDataTableauParticipants.cy.ts +++ b/cypress/e2e/Telechargement/ClinicalDataTableauParticipants_2.cy.ts @@ -11,29 +11,11 @@ beforeEach(() => { cy.visitDataExploration('participants', '?sharedFilterId=75272e84-9a2d-4e0b-b69e-fb9e5df63762'); cy.get('div[role="tabpanel"] [class*="ant-table-row"]').eq(0).find('[type="checkbox"]').check({force: true}); cy.get('[class*="Header_ProTableHeader"] button[class*="ant-dropdown-trigger"]').eq(1).click({force: true}); -}); - -describe('Page Data Exploration (Participants) - Télécharger le clinical data', () => { - beforeEach(() => { - cy.clickAndIntercept('[data-menu-id*="-clinicalData"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName(`include_clinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); - }); - - it('Valider le contenu du fichier [SJIP-1233]', () => { - cy.validateXlsxFileContent('DownloadClinicalData.json'); - }); + cy.clickAndIntercept('[data-menu-id*="-familyClinicalData"]', 'POST', '**/file-manifest', 1); + cy.waitUntilFile(oneMinute); }); describe('Page Data Exploration (Participants) - Télécharger le clinical data (family)', () => { - beforeEach(() => { - cy.clickAndIntercept('[data-menu-id*="-familyClinicalData"]', 'POST', '**/file-manifest', 1); - cy.waitUntilFile(oneMinute); - }); - it('Valider le nom du fichier', () => { cy.validateFileName(`include_familyClinicalData_${strDate.slice(0, 4)}${strDate.slice(4, 6)}${strDate.slice(6, 8)}T*.xlsx`); }); diff --git a/cypress/e2e/Telechargement/TableauxPageFile.cy.ts b/cypress/e2e/Telechargement/TableauxPageFile.cy.ts index d1ea4c2b..c50c2233 100644 --- a/cypress/e2e/Telechargement/TableauxPageFile.cy.ts +++ b/cypress/e2e/Telechargement/TableauxPageFile.cy.ts @@ -6,16 +6,13 @@ const { strDate } = getDateTime(); beforeEach(() => { cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); cy.login(); + cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); + cy.resetColumns('participant-sample'); + cy.get('div[id="content"] svg[data-icon="download"]').eq(1).clickAndWait({force:true}); + cy.waitUntilFile(oneMinute); }); -describe('Page d\'un fichier - Exporter le tableau Participants-Samples en TSV', () => { - beforeEach(() => { - cy.visitFileEntity('HTP.1730dafb-464b-4aa6-b2dc-35f729cbdb2d.CGP.filtered.deNovo.vep.vcf.gz'); - cy.resetColumns('participant-sample'); - cy.get('div[id="content"] svg[data-icon="download"]').eq(1).clickAndWait({force:true}); - cy.waitUntilFile(oneMinute); - }); - +describe('Page d\'un fichier - Exporter le tableau Participants-Samples en TSV', () => { it('Valider le nom du fichier', () => { cy.validateFileName('include-participants-samples-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); }); diff --git a/cypress/e2e/Telechargement/TableauxPageParticipant.cy.ts b/cypress/e2e/Telechargement/TableauxPageParticipant.cy.ts deleted file mode 100644 index 82ee4dce..00000000 --- a/cypress/e2e/Telechargement/TableauxPageParticipant.cy.ts +++ /dev/null @@ -1,93 +0,0 @@ -/// -import { getDateTime, oneMinute } from '../../support/utils'; - -const { strDate } = getDateTime(); - -beforeEach(() => { - cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); - cy.login(); -}); - -describe('Page d\'un participant - Exporter le tableau Family en TSV', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('family'); - cy.get('div[id="content"] svg[data-icon="download"]').eq(1).clickAndWait({force:true}); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include-family-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('ExportTableauFamilyPageParticipant.json'); - }); - - it('Valider le contenu du fichier', () => { - cy.validateFileContent('ExportTableauFamilyPageParticipant.json'); - }); -}); - -describe('Page d\'un participant - Exporter le tableau Diagnoses en TSV', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('diagnosis'); - cy.get('div[id="content"] svg[data-icon="download"]').eq(2).clickAndWait({force:true}); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include-diagnoses-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('ExportTableauDiagnosesPageParticipant.json'); - }); - - it('Valider le contenu du fichier [SJIP-584]', () => { - cy.validateFileContent('ExportTableauDiagnosesPageParticipant.json'); - }); -}); - -describe('Page d\'un participant - Exporter le tableau Phenotypes en TSV', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('phenotype'); - cy.get('div[id="content"] svg[data-icon="download"]').eq(3).clickAndWait({force:true}); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include-phenotypes-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('ExportTableauPhenotypesPageParticipant.json'); - }); - - it('Valider le contenu du fichier [SJIP-584]', () => { - cy.validateFileContent('ExportTableauPhenotypesPageParticipant.json'); - }); -}); - -describe('Page d\'un participant - Exporter le tableau Biospecimens en TSV', () => { - beforeEach(() => { - cy.visitParticipantEntity('pt-0dxdyebh'); - cy.resetColumns('biospecimen'); - cy.get('div[id="content"] svg[data-icon="download"]').eq(5).clickAndWait({force:true}); - cy.waitUntilFile(oneMinute); - }); - - it('Valider le nom du fichier', () => { - cy.validateFileName('include-biospecimens-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); - }); - - it('Valider les en-têtes du fichier', () => { - cy.validateFileHeaders('ExportTableauBiospecimensPageParticipant.json'); - }); - - it('Valider le contenu du fichier', () => { - cy.validateFileContent('ExportTableauBiospecimensPageParticipant.json'); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/Telechargement/TableauxPageParticipant_1.cy.ts b/cypress/e2e/Telechargement/TableauxPageParticipant_1.cy.ts new file mode 100644 index 00000000..814218d0 --- /dev/null +++ b/cypress/e2e/Telechargement/TableauxPageParticipant_1.cy.ts @@ -0,0 +1,27 @@ +/// +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('family'); + cy.get('div[id="content"] svg[data-icon="download"]').eq(1).clickAndWait({force:true}); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un participant - Exporter le tableau Family en TSV', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include-family-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('ExportTableauFamilyPageParticipant.json'); + }); + + it('Valider le contenu du fichier', () => { + cy.validateFileContent('ExportTableauFamilyPageParticipant.json'); + }); +}); diff --git a/cypress/e2e/Telechargement/TableauxPageParticipant_2.cy.ts b/cypress/e2e/Telechargement/TableauxPageParticipant_2.cy.ts new file mode 100644 index 00000000..5f94c6c2 --- /dev/null +++ b/cypress/e2e/Telechargement/TableauxPageParticipant_2.cy.ts @@ -0,0 +1,27 @@ +/// +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('diagnosis'); + cy.get('div[id="content"] svg[data-icon="download"]').eq(2).clickAndWait({force:true}); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un participant - Exporter le tableau Diagnoses en TSV', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include-diagnoses-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('ExportTableauDiagnosesPageParticipant.json'); + }); + + it('Valider le contenu du fichier [SJIP-584]', () => { + cy.validateFileContent('ExportTableauDiagnosesPageParticipant.json'); + }); +}); diff --git a/cypress/e2e/Telechargement/TableauxPageParticipant_3.cy.ts b/cypress/e2e/Telechargement/TableauxPageParticipant_3.cy.ts new file mode 100644 index 00000000..8c8cdbed --- /dev/null +++ b/cypress/e2e/Telechargement/TableauxPageParticipant_3.cy.ts @@ -0,0 +1,27 @@ +/// +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('phenotype'); + cy.get('div[id="content"] svg[data-icon="download"]').eq(3).clickAndWait({force:true}); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un participant - Exporter le tableau Phenotypes en TSV', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include-phenotypes-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('ExportTableauPhenotypesPageParticipant.json'); + }); + + it('Valider le contenu du fichier [SJIP-584]', () => { + cy.validateFileContent('ExportTableauPhenotypesPageParticipant.json'); + }); +}); diff --git a/cypress/e2e/Telechargement/TableauxPageParticipant_4.cy.ts b/cypress/e2e/Telechargement/TableauxPageParticipant_4.cy.ts new file mode 100644 index 00000000..ad8c28fb --- /dev/null +++ b/cypress/e2e/Telechargement/TableauxPageParticipant_4.cy.ts @@ -0,0 +1,27 @@ +/// +import { getDateTime, oneMinute } from '../../support/utils'; + +const { strDate } = getDateTime(); + +beforeEach(() => { + cy.removeFilesFromFolder(Cypress.config('downloadsFolder')); + cy.login(); + cy.visitParticipantEntity('pt-0dxdyebh'); + cy.resetColumns('biospecimen'); + cy.get('div[id="content"] svg[data-icon="download"]').eq(5).clickAndWait({force:true}); + cy.waitUntilFile(oneMinute); +}); + +describe('Page d\'un participant - Exporter le tableau Biospecimens en TSV', () => { + it('Valider le nom du fichier', () => { + cy.validateFileName('include-biospecimens-table-'+`${strDate.slice(0, 4)}-${strDate.slice(4, 6)}-${strDate.slice(6, 8)}`+'.tsv'); + }); + + it('Valider les en-têtes du fichier', () => { + cy.validateFileHeaders('ExportTableauBiospecimensPageParticipant.json'); + }); + + it('Valider le contenu du fichier', () => { + cy.validateFileContent('ExportTableauBiospecimensPageParticipant.json'); + }); +}); diff --git a/cypress/e2e/UploadList/PageDataExploration.cy.ts b/cypress/e2e/UploadList/PageDataExploration.cy.ts deleted file mode 100644 index 7528d2f4..00000000 --- a/cypress/e2e/UploadList/PageDataExploration.cy.ts +++ /dev/null @@ -1,276 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page Data Exploration (Participants) - Téléverser une liste d\'identifiants', () => { - - beforeEach(() => { - cy.login(); - cy.visitDataExploration('participants'); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - cy.get('button[class*="UploadIdsButton"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] textarea').type('PT-AS0AEPQM,htp0577 unknown'); - }); - - it('Vérifier les informations affichées - Popover', () => { - cy.get('[class*="UploadModal"] [class*="anticon-info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').should('not.have.class', 'ant-popover-hidden'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers and File Formats').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Participant ID, External Participant ID').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Separated by').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('comma, space, new line').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Upload file formats').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('.txt, .csv, .tsv').should('exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Supprimer', () => { - cy.get('[class*="UploadModal"] textarea').contains('PT-AS0AEPQM').should('exist'); - cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').clickAndWait({force: true}); - - cy.get('[class*="UploadModal"] textarea').contains('PT-AS0AEPQM').should('not.exist'); - cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').should('not.exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Annuler', () => { - cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').clickAndWait({force: true}); - - cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); - }); - - it('Valider les fonctionnalités de la modal - Section Résumé masquable', () => { - cy.get('[class*="UploadModal"] [class="ant-collapse-header-text"]').contains('Summary Table (2 matched, 1 unmatched)').should('exist'); - - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-active"]').should('exist'); - - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - }); - - it('Vérifier les informations affichées - Section Résumé (onglet Reconnus)', () => { - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - - cy.get('[class*="UploadModal_tablesMessages"]').contains('3 submitted identifiers mapped to 1 unique system identifiers').should('exist'); - cy.get('[data-node-key="matched"]').contains('Matched (2)').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Submitted participant identifiers').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Mapped to').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Participant ID').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Study').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:0"] td').eq(0).contains('PT-AS0AEPQM').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:0"] td').eq(1).contains('pt-as0aepqm').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:0"] td').eq(2).contains('HTP').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:1"] td').eq(0).contains('htp0577').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:1"] td').eq(1).contains('pt-as0aepqm').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:1"] td').eq(2).contains('HTP').should('exist'); - }); - - it('Vérifier les informations affichées - Section Résumé (onglet Inconnus)', () => { - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[data-node-key="unmatched"]').clickAndWait({force: true}); - - cy.get('[data-node-key="unmatched"]').contains('Unmatched (1)').should('exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Submitted participant identifiers').should('exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Mapped to').should('not.exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Participant ID').should('not.exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Study').should('not.exist'); - cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(0).contains('unknown').should('exist'); - cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(1).should('not.exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Téléverser', () => { - cy.wait(2000); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/graphql', 3); - - cy.validatePillSelectedQuery('Participant ID', ['Uploaded List']); - cy.validateTotalSelectedQuery('1'); - cy.validateTableResultsCount('1'); - cy.get('[class*="ant-select-show-search"] [class="ant-tag"]').should('not.exist'); - - cy.get('[class*="QueryValues_queryValuesContainer"]').contains('Uploaded List').clickAndWait({force:true}); - cy.get('[class*="filtersDropdown"]').should('not.exist'); - }); -}); - -describe('Page Data Exploration (Biospecimens) - Téléverser une liste d\'identifiants', () => { - - beforeEach(() => { - cy.login(); - cy.visitDataExploration('biospecimens'); - cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); - cy.get('button[class*="UploadIdsButton"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] textarea').type('BS-03YNYNFS,htp0577a_paxgenewholebloodrna unknown'); - }); - - it('Vérifier les informations affichées - Popover', () => { - cy.get('[class*="UploadModal"] [class*="anticon-info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').should('not.have.class', 'ant-popover-hidden'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers and File Formats').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Sample ID, External Sample ID').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Separated by').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('comma, space, new line').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Upload file formats').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('.txt, .csv, .tsv').should('exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Supprimer', () => { - cy.get('[class*="UploadModal"] textarea').contains('BS-03YNYNFS').should('exist'); - cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').clickAndWait({force: true}); - - cy.get('[class*="UploadModal"] textarea').contains('BS-03YNYNFS').should('not.exist'); - cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').should('not.exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Annuler', () => { - cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').clickAndWait({force: true}); - - cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); - }); - - it('Valider les fonctionnalités de la modal - Section Résumé masquable', () => { - cy.get('[class*="UploadModal"] [class="ant-collapse-header-text"]').contains('Summary Table (2 matched, 1 unmatched)').should('exist'); - - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-active"]').should('exist'); - - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - }); - - it('Vérifier les informations affichées - Section Résumé (onglet Reconnus)', () => { - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - - cy.get('[class*="UploadModal_tablesMessages"]').contains('3 submitted identifiers mapped to 1 unique system identifiers').should('exist'); - cy.get('[data-node-key="matched"]').contains('Matched (2)').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Submitted sample identifiers').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Mapped to').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Sample ID').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Study').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:0"] td').eq(0).contains('BS-03YNYNFS').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:0"] td').eq(1).contains('bs-03ynynfs').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:0"] td').eq(2).contains('HTP').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:1"] td').eq(0).contains('htp0577a_paxgenewholebloodrna').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:1"] td').eq(1).contains('bs-03ynynfs').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:1"] td').eq(2).contains('HTP').should('exist'); - }); - - it('Vérifier les informations affichées - Section Résumé (onglet Inconnus)', () => { - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[data-node-key="unmatched"]').clickAndWait({force: true}); - - cy.get('[data-node-key="unmatched"]').contains('Unmatched (1)').should('exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Submitted sample identifiers').should('exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Mapped to').should('not.exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Sample ID').should('not.exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Study').should('not.exist'); - cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(0).contains('unknown').should('exist'); - cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(1).should('not.exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Téléverser', () => { - cy.wait(2000); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/graphql', 3); - - cy.validatePillSelectedQuery('Sample ID', ['Uploaded List']); - cy.validateTotalSelectedQuery('1'); - cy.validateTableResultsCount('1'); - cy.get('[class*="ant-select-show-search"] [class="ant-tag"]').should('not.exist'); - - cy.get('[class*="QueryValues_queryValuesContainer"]').contains('Uploaded List').clickAndWait({force:true}); - cy.get('[class*="filtersDropdown"]').should('not.exist'); - }); -}); - -describe('Page Data Exploration (Data Files) - Téléverser une liste d\'identifiants', () => { - - beforeEach(() => { - cy.login(); - cy.visitDataExploration('datafiles'); - cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); - cy.get('button[class*="UploadIdsButton"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] textarea').type('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz,unknown'); - }); - - it('Vérifier les informations affichées - Popover', () => { - cy.get('[class*="UploadModal"] [class*="anticon-info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').should('not.have.class', 'ant-popover-hidden'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers and File Formats').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('File ID').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Separated by').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('comma, space, new line').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Upload file formats').should('exist'); - cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('.txt, .csv, .tsv').should('exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Supprimer', () => { - cy.get('[class*="UploadModal"] textarea').contains('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); - cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').clickAndWait({force: true}); - - cy.get('[class*="UploadModal"] textarea').contains('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('not.exist'); - cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').should('not.exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Annuler', () => { - cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').clickAndWait({force: true}); - - cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); - }); - - it('Valider les fonctionnalités de la modal - Section Résumé masquable', () => { - cy.get('[class*="UploadModal"] [class="ant-collapse-header-text"]').contains('Summary Table (1 matched, 1 unmatched)').should('exist'); - - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-active"]').should('exist'); - - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); - }); - - it('Vérifier les informations affichées - Section Résumé (onglet Reconnus)', () => { - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - - cy.get('[class*="UploadModal_tablesMessages"]').contains('2 submitted identifiers mapped to 1 unique system identifiers').should('exist'); - cy.get('[data-node-key="matched"]').contains('Matched (1)').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Submitted file identifiers').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Mapped to').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('File ID').should('exist'); - cy.get('[id*="panel-matched"] thead').contains('Study').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz:0"] td').eq(0).contains('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz:0"] td').eq(1).contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); - cy.get('[id*="panel-matched"] [data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz:0"] td').eq(2).contains('HTP').should('exist'); - }); - - it('Vérifier les informations affichées - Section Résumé (onglet Inconnus)', () => { - cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); - cy.get('[data-node-key="unmatched"]').clickAndWait({force: true}); - - cy.get('[data-node-key="unmatched"]').contains('Unmatched (1)').should('exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Submitted file identifiers').should('exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Mapped to').should('not.exist'); - cy.get('[id*="panel-unmatched"] thead').contains('File ID').should('not.exist'); - cy.get('[id*="panel-unmatched"] thead').contains('Study').should('not.exist'); - cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(0).contains('unknown').should('exist'); - cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(1).should('not.exist'); - }); - - it('Valider les fonctionnalités de la modal - Bouton Téléverser', () => { - cy.wait(2000); - cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/graphql', 3); - - cy.validatePillSelectedQuery('File ID', ['Uploaded List']); - cy.validateTotalSelectedQuery('1'); - cy.validateTableResultsCount('1'); - cy.get('[class*="ant-select-show-search"] [class="ant-tag"]').should('not.exist'); - - cy.get('[class*="QueryValues_queryValuesContainer"]').contains('Uploaded List').clickAndWait({force:true}); - cy.get('[class*="filtersDropdown"]').should('not.exist'); - }); -}); diff --git a/cypress/e2e/UploadList/PageDataExploration_1.cy.ts b/cypress/e2e/UploadList/PageDataExploration_1.cy.ts new file mode 100644 index 00000000..9382be56 --- /dev/null +++ b/cypress/e2e/UploadList/PageDataExploration_1.cy.ts @@ -0,0 +1,92 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); + cy.get('button[class*="UploadIdsButton"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] textarea').type('PT-AS0AEPQM,htp0577 unknown'); +}); + +describe('Page Data Exploration (Participants) - Téléverser une liste d\'identifiants', () => { + it('Vérifier les informations affichées - Popover', () => { + cy.get('[class*="UploadModal"] [class*="anticon-info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').should('not.have.class', 'ant-popover-hidden'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers and File Formats').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Participant ID, External Participant ID').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Separated by').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('comma, space, new line').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Upload file formats').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('.txt, .csv, .tsv').should('exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Supprimer', () => { + cy.get('[class*="UploadModal"] textarea').contains('PT-AS0AEPQM').should('exist'); + cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').clickAndWait({force: true}); + + cy.get('[class*="UploadModal"] textarea').contains('PT-AS0AEPQM').should('not.exist'); + cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').should('not.exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Annuler', () => { + cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').clickAndWait({force: true}); + + cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); + }); + + it('Valider les fonctionnalités de la modal - Section Résumé masquable', () => { + cy.get('[class*="UploadModal"] [class="ant-collapse-header-text"]').contains('Summary Table (2 matched, 1 unmatched)').should('exist'); + + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-active"]').should('exist'); + + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + }); + + it('Vérifier les informations affichées - Section Résumé (onglet Reconnus)', () => { + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + + cy.get('[class*="UploadModal_tablesMessages"]').contains('3 submitted identifiers mapped to 1 unique system identifiers').should('exist'); + cy.get('[data-node-key="matched"]').contains('Matched (2)').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Submitted participant identifiers').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Mapped to').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Participant ID').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Study').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:0"] td').eq(0).contains('PT-AS0AEPQM').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:0"] td').eq(1).contains('pt-as0aepqm').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:0"] td').eq(2).contains('HTP').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:1"] td').eq(0).contains('htp0577').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:1"] td').eq(1).contains('pt-as0aepqm').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="pt-as0aepqm:1"] td').eq(2).contains('HTP').should('exist'); + }); + + it('Vérifier les informations affichées - Section Résumé (onglet Inconnus)', () => { + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[data-node-key="unmatched"]').clickAndWait({force: true}); + + cy.get('[data-node-key="unmatched"]').contains('Unmatched (1)').should('exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Submitted participant identifiers').should('exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Mapped to').should('not.exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Participant ID').should('not.exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Study').should('not.exist'); + cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(0).contains('unknown').should('exist'); + cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(1).should('not.exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Téléverser', () => { + cy.wait(2000); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/graphql', 3); + + cy.validatePillSelectedQuery('Participant ID', ['Uploaded List']); + cy.validateTotalSelectedQuery('1'); + cy.validateTableResultsCount('1'); + cy.get('[class*="ant-select-show-search"] [class="ant-tag"]').should('not.exist'); + + cy.get('[class*="QueryValues_queryValuesContainer"]').contains('Uploaded List').clickAndWait({force:true}); + cy.get('[class*="filtersDropdown"]').should('not.exist'); + }); +}); diff --git a/cypress/e2e/UploadList/PageDataExploration_2.cy.ts b/cypress/e2e/UploadList/PageDataExploration_2.cy.ts new file mode 100644 index 00000000..13a82aa1 --- /dev/null +++ b/cypress/e2e/UploadList/PageDataExploration_2.cy.ts @@ -0,0 +1,92 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('biospecimens'); + cy.get('[data-cy="SidebarMenuItem_Biospecimen"]').clickAndWait({force: true}); + cy.get('button[class*="UploadIdsButton"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] textarea').type('BS-03YNYNFS,htp0577a_paxgenewholebloodrna unknown'); +}); + +describe('Page Data Exploration (Biospecimens) - Téléverser une liste d\'identifiants', () => { + it('Vérifier les informations affichées - Popover', () => { + cy.get('[class*="UploadModal"] [class*="anticon-info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').should('not.have.class', 'ant-popover-hidden'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers and File Formats').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Sample ID, External Sample ID').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Separated by').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('comma, space, new line').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Upload file formats').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('.txt, .csv, .tsv').should('exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Supprimer', () => { + cy.get('[class*="UploadModal"] textarea').contains('BS-03YNYNFS').should('exist'); + cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').clickAndWait({force: true}); + + cy.get('[class*="UploadModal"] textarea').contains('BS-03YNYNFS').should('not.exist'); + cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').should('not.exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Annuler', () => { + cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').clickAndWait({force: true}); + + cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); + }); + + it('Valider les fonctionnalités de la modal - Section Résumé masquable', () => { + cy.get('[class*="UploadModal"] [class="ant-collapse-header-text"]').contains('Summary Table (2 matched, 1 unmatched)').should('exist'); + + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-active"]').should('exist'); + + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + }); + + it('Vérifier les informations affichées - Section Résumé (onglet Reconnus)', () => { + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + + cy.get('[class*="UploadModal_tablesMessages"]').contains('3 submitted identifiers mapped to 1 unique system identifiers').should('exist'); + cy.get('[data-node-key="matched"]').contains('Matched (2)').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Submitted sample identifiers').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Mapped to').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Sample ID').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Study').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:0"] td').eq(0).contains('BS-03YNYNFS').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:0"] td').eq(1).contains('bs-03ynynfs').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:0"] td').eq(2).contains('HTP').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:1"] td').eq(0).contains('htp0577a_paxgenewholebloodrna').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:1"] td').eq(1).contains('bs-03ynynfs').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="bs-03ynynfs:1"] td').eq(2).contains('HTP').should('exist'); + }); + + it('Vérifier les informations affichées - Section Résumé (onglet Inconnus)', () => { + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[data-node-key="unmatched"]').clickAndWait({force: true}); + + cy.get('[data-node-key="unmatched"]').contains('Unmatched (1)').should('exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Submitted sample identifiers').should('exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Mapped to').should('not.exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Sample ID').should('not.exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Study').should('not.exist'); + cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(0).contains('unknown').should('exist'); + cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(1).should('not.exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Téléverser', () => { + cy.wait(2000); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/graphql', 3); + + cy.validatePillSelectedQuery('Sample ID', ['Uploaded List']); + cy.validateTotalSelectedQuery('1'); + cy.validateTableResultsCount('1'); + cy.get('[class*="ant-select-show-search"] [class="ant-tag"]').should('not.exist'); + + cy.get('[class*="QueryValues_queryValuesContainer"]').contains('Uploaded List').clickAndWait({force:true}); + cy.get('[class*="filtersDropdown"]').should('not.exist'); + }); +}); diff --git a/cypress/e2e/UploadList/PageDataExploration_3.cy.ts b/cypress/e2e/UploadList/PageDataExploration_3.cy.ts new file mode 100644 index 00000000..b2169fbb --- /dev/null +++ b/cypress/e2e/UploadList/PageDataExploration_3.cy.ts @@ -0,0 +1,89 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('datafiles'); + cy.get('[data-cy="SidebarMenuItem_Data File"]').clickAndWait({force: true}); + cy.get('button[class*="UploadIdsButton"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] textarea').type('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz,unknown'); +}); + +describe('Page Data Exploration (Data Files) - Téléverser une liste d\'identifiants', () => { + it('Vérifier les informations affichées - Popover', () => { + cy.get('[class*="UploadModal"] [class*="anticon-info-circle"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').should('not.have.class', 'ant-popover-hidden'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers and File Formats').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Identifiers').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('File ID').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Separated by').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('comma, space, new line').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('Upload file formats').should('exist'); + cy.get('[class*="EntityUploadIds_entityUploadIdsPopover"]').contains('.txt, .csv, .tsv').should('exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Supprimer', () => { + cy.get('[class*="UploadModal"] textarea').contains('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); + cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').clickAndWait({force: true}); + + cy.get('[class*="UploadModal"] textarea').contains('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('not.exist'); + cy.get('[class*="UploadModal"] button[class*="ant-btn-text"]').should('not.exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Annuler', () => { + cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').clickAndWait({force: true}); + + cy.get('body').contains('Use the search tools & facets on the left to build a query').should('exist'); + }); + + it('Valider les fonctionnalités de la modal - Section Résumé masquable', () => { + cy.get('[class*="UploadModal"] [class="ant-collapse-header-text"]').contains('Summary Table (1 matched, 1 unmatched)').should('exist'); + + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-active"]').should('exist'); + + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[class*="UploadModal"] div[class*="ant-collapse-content-inactive ant-collapse-content-hidden"]').should('exist'); + }); + + it('Vérifier les informations affichées - Section Résumé (onglet Reconnus)', () => { + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + + cy.get('[class*="UploadModal_tablesMessages"]').contains('2 submitted identifiers mapped to 1 unique system identifiers').should('exist'); + cy.get('[data-node-key="matched"]').contains('Matched (1)').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Submitted file identifiers').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Mapped to').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('File ID').should('exist'); + cy.get('[id*="panel-matched"] thead').contains('Study').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz:0"] td').eq(0).contains('htp.htp0577a_frrb192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz:0"] td').eq(1).contains('HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz').should('exist'); + cy.get('[id*="panel-matched"] [data-row-key="HTP.HTP0577A_FRRB192320222-1a_HWHKMDSXX_L1_2.fq.gz:0"] td').eq(2).contains('HTP').should('exist'); + }); + + it('Vérifier les informations affichées - Section Résumé (onglet Inconnus)', () => { + cy.get('[class*="UploadModal"] span[class*="ant-collapse-arrow"]').clickAndWait({force: true}); + cy.get('[data-node-key="unmatched"]').clickAndWait({force: true}); + + cy.get('[data-node-key="unmatched"]').contains('Unmatched (1)').should('exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Submitted file identifiers').should('exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Mapped to').should('not.exist'); + cy.get('[id*="panel-unmatched"] thead').contains('File ID').should('not.exist'); + cy.get('[id*="panel-unmatched"] thead').contains('Study').should('not.exist'); + cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(0).contains('unknown').should('exist'); + cy.get('[id*="panel-unmatched"] [data-row-key="0"] td').eq(1).should('not.exist'); + }); + + it('Valider les fonctionnalités de la modal - Bouton Téléverser', () => { + cy.wait(2000); + cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/graphql', 3); + + cy.validatePillSelectedQuery('File ID', ['Uploaded List']); + cy.validateTotalSelectedQuery('1'); + cy.validateTableResultsCount('1'); + cy.get('[class*="ant-select-show-search"] [class="ant-tag"]').should('not.exist'); + + cy.get('[class*="QueryValues_queryValuesContainer"]').contains('Uploaded List').clickAndWait({force:true}); + cy.get('[class*="filtersDropdown"]').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Widgets/AuthorizedStudies_1.cy.ts b/cypress/e2e/Widgets/AuthorizedStudies_1.cy.ts new file mode 100644 index 00000000..f08c6ae2 --- /dev/null +++ b/cypress/e2e/Widgets/AuthorizedStudies_1.cy.ts @@ -0,0 +1,38 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Authorized Studies (déconnecté)', () => { + it('Vérifier les informations affichées - Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Authorized Studies')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('[class="ant-popover-title"]').contains('Accessing Data').should('exist'); + cy.get('[class="ant-popover-inner-content"]').contains('Users requesting access to controlled data are required to have an eRA Commons account. Read more on').should('exist'); + }); + + it('Valider les liens disponibles - Applying du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Authorized Studies')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href="https://dbgap.ncbi.nlm.nih.gov/aa/wga.cgi?login=&page=login"]').contains('applying for data access').should('exist'); + }); + + it('Vérifier les informations affichées - Carte', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Authorized Studies')) { + cy.wrap($el).find('[class*="Gridcard_contentWrapper"]').as('gridCard'); + } + }); + cy.get('@gridCard').contains('Access INCLUDE controlled-access data by connecting your account using your NIH Credentials.').should('exist'); + cy.get('@gridCard').find('button').contains('Connect').should('exist'); + }); +}); diff --git a/cypress/e2e/Widgets/AuthorizedStudies.cy.ts b/cypress/e2e/Widgets/AuthorizedStudies_2.cy.ts similarity index 51% rename from cypress/e2e/Widgets/AuthorizedStudies.cy.ts rename to cypress/e2e/Widgets/AuthorizedStudies_2.cy.ts index ed0a1758..bbaf91c0 100644 --- a/cypress/e2e/Widgets/AuthorizedStudies.cy.ts +++ b/cypress/e2e/Widgets/AuthorizedStudies_2.cy.ts @@ -3,80 +3,42 @@ import '../../support/commands'; beforeEach(() => { cy.login(); -}); - -describe('Page Dashboard - Widget Authorized Studies (déconnecté)', () => { - beforeEach(() => { - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Authorized Studies')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + cy.intercept('GET', '**/fence/gen3/authenticated', { + statusCode: 200, + body: { + "authenticated": true, + "expiration": 1722785256 + }, + }).as('authStudiesAuthenticated'); + cy.intercept('POST', '**/authorized-studies', { + statusCode: 200, + body: { + "gen3": { + "data": [ + { + "study_id": "Study_ID", + "user_acl_in_study": [ + "phs012345.cy", + "open_access" + ], + "study_code": "Study_Cypress", + "title": "Cypress: (Test) A mock study for Cypress tests", + "authorized_controlled_files_count": 1234, + "total_files_count": 5678, + "total_authorized_files_count": 3456 + } + ], + "error": false } - }); - cy.get('[class="ant-popover-title"]').contains('Accessing Data').should('exist'); - cy.get('[class="ant-popover-inner-content"]').contains('Users requesting access to controlled data are required to have an eRA Commons account. Read more on').should('exist'); - }); + }, + }).as('authStudiesList'); - it('Valider les liens disponibles - Applying du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Authorized Studies')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href="https://dbgap.ncbi.nlm.nih.gov/aa/wga.cgi?login=&page=login"]').contains('applying for data access').should('exist'); - }); - - it('Vérifier les informations affichées - Carte', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Authorized Studies')) { - cy.wrap($el).find('[class*="Gridcard_contentWrapper"]').as('gridCard'); - } - }); - cy.get('@gridCard').contains('Access INCLUDE controlled-access data by connecting your account using your NIH Credentials.').should('exist'); - cy.get('@gridCard').find('button').contains('Connect').should('exist'); - }); + cy.visitDashboard(); + cy.wait('@authStudiesAuthenticated'); + cy.wait('@authStudiesList'); }); describe('Page Dashboard - Widget Authorized Studies (connecté)', () => { - beforeEach(() => { - cy.intercept('GET', '**/fence/gen3/authenticated', { - statusCode: 200, - body: { - "authenticated": true, - "expiration": 1722785256 - }, - }).as('authStudiesAuthenticated'); - cy.intercept('POST', '**/authorized-studies', { - statusCode: 200, - body: { - "gen3": { - "data": [ - { - "study_id": "Study_ID", - "user_acl_in_study": [ - "phs012345.cy", - "open_access" - ], - "study_code": "Study_Cypress", - "title": "Cypress: (Test) A mock study for Cypress tests", - "authorized_controlled_files_count": 1234, - "total_files_count": 5678, - "total_authorized_files_count": 3456 - } - ], - "error": false - } - }, - }).as('authStudiesList'); - - cy.visitDashboard(); - cy.wait('@authStudiesAuthenticated'); - cy.wait('@authStudiesList'); - }); - it('Vérifier les informations affichées - Header', () => { cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { if ($el.text().includes('Authorized Studies')) { diff --git a/cypress/e2e/Widgets/BiospecimenRequests.cy.ts b/cypress/e2e/Widgets/BiospecimenRequests.cy.ts deleted file mode 100644 index 3580f6b2..00000000 --- a/cypress/e2e/Widgets/BiospecimenRequests.cy.ts +++ /dev/null @@ -1,128 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page Dashboard - Widget Biospecimen Requests', () => { - beforeEach(() => { - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('[class="ant-popover-title"]').contains('Your Request History').should('exist'); - cy.get('[class="ant-popover-inner-content"]').contains('This card holds the history of your biospecimen requests. You can reload them in the ').should('exist'); - cy.get('[class="ant-popover-inner-content"]').contains(' or share the link.').should('exist'); - }); - - it('Valider les liens disponibles - Data Exploration du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href]').contains('Data Exploration').clickAndWait({force: true}); - cy.get('[class*="DataExploration_title"]').should('exist'); - }); -}); - -describe('Page Dashboard - Widget Biospecimen Requests', () => { - beforeEach(() => { - cy.createBioReqIfNotExists('Cypress_BrB', 0); - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Nom', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').contains('Cypress_BrB').should('exist'); - }); - - it('Vérifier les informations affichées - Stamp', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').contains('Last saved:').should('exist'); - cy.get('@dashboardCard').contains(' ago').should('exist'); - }); - - it('Valider les liens disponibles - Nom', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').contains('Cypress_BrB').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Biospecimen').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress_BrB').should('exist'); - }); - - // Ne fonctionne pas, le popup "Copy to clipboard: ⌘+C, Enter" s'affiche et bloque le test - it.skip('Valider les liens disponibles - Bouton ShareUrl', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').find('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { - if ($el.text().includes('Cypress_BrA')) { - cy.wrap($el).find('svg[data-icon="share-alt"]').clickAndWait({force:true}); - }; - }); - // TODO: Récupérer l'rul copié et la valider - }); - - it('Valider les liens disponibles - Bouton Delete', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').contains('Cypress_BrB').should('exist'); - cy.deleteBioReqIfExists('Cypress_BrB'); - }); -}); - -describe('Page Dashboard - Widget Biospecimen Requests', () => { - beforeEach(() => { - cy.createBioReqIfNotExists('Cypress_BrA', 0); - cy.deleteBioReqIfExists('Cypress_BrB'); - cy.visitDashboard(); - }); - - it('Valider les liens disponibles - Bouton Edit', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').find('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { - if ($el.text().includes('Cypress_BrA')) { - cy.wrap($el).find('svg[data-icon="edit"]').clickAndWait({force:true}); - }; - }); - cy.get('[class="ant-modal-content"] input').filter(':visible').clear().type('Cypress_BrB'); - cy.get(`[class="ant-modal-content"] input[value="Cypress_BrB"]`).should('exist'); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1, true/*beVisible*/); - - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Biospecimen Requests')) { - cy.wrap($el).as('dashboardCard'); - }; - }); - cy.get('@dashboardCard').contains('Cypress_BrB').should('exist'); - cy.get('@dashboardCard').contains('Cypress_BrA').should('not.exist'); - }); -}); diff --git a/cypress/e2e/Widgets/BiospecimenRequests_1.cy.ts b/cypress/e2e/Widgets/BiospecimenRequests_1.cy.ts new file mode 100644 index 00000000..7e4feedd --- /dev/null +++ b/cypress/e2e/Widgets/BiospecimenRequests_1.cy.ts @@ -0,0 +1,30 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Biospecimen Requests', () => { + it('Vérifier les informations affichées - Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('[class="ant-popover-title"]').contains('Your Request History').should('exist'); + cy.get('[class="ant-popover-inner-content"]').contains('This card holds the history of your biospecimen requests. You can reload them in the ').should('exist'); + cy.get('[class="ant-popover-inner-content"]').contains(' or share the link.').should('exist'); + }); + + it('Valider les liens disponibles - Data Exploration du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href]').contains('Data Exploration').clickAndWait({force: true}); + cy.get('[class*="DataExploration_title"]').should('exist'); + }); +}); diff --git a/cypress/e2e/Widgets/BiospecimenRequests_2.cy.ts b/cypress/e2e/Widgets/BiospecimenRequests_2.cy.ts new file mode 100644 index 00000000..9017ec38 --- /dev/null +++ b/cypress/e2e/Widgets/BiospecimenRequests_2.cy.ts @@ -0,0 +1,51 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.createBioReqIfNotExists('Cypress_BrB', 0); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Biospecimen Requests', () => { + it('Vérifier les informations affichées - Nom', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).as('dashboardCard'); + }; + }); + cy.get('@dashboardCard').contains('Cypress_BrB').should('exist'); + }); + + it('Vérifier les informations affichées - Stamp', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).as('dashboardCard'); + }; + }); + cy.get('@dashboardCard').contains('Last saved:').should('exist'); + cy.get('@dashboardCard').contains(' ago').should('exist'); + }); + + it('Valider les liens disponibles - Nom', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).as('dashboardCard'); + }; + }); + cy.get('@dashboardCard').contains('Cypress_BrB').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Biospecimen').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress_BrB').should('exist'); + }); + + it('Valider les liens disponibles - Bouton Delete', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).as('dashboardCard'); + }; + }); + cy.get('@dashboardCard').contains('Cypress_BrB').should('exist'); + cy.deleteBioReqIfExists('Cypress_BrB'); + }); +}); diff --git a/cypress/e2e/Widgets/BiospecimenRequests_3.cy.ts b/cypress/e2e/Widgets/BiospecimenRequests_3.cy.ts new file mode 100644 index 00000000..6f6d7073 --- /dev/null +++ b/cypress/e2e/Widgets/BiospecimenRequests_3.cy.ts @@ -0,0 +1,35 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.createBioReqIfNotExists('Cypress_BrA', 0); + cy.deleteBioReqIfExists('Cypress_BrB'); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Biospecimen Requests', () => { + it('Valider les liens disponibles - Bouton Edit', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).as('dashboardCard'); + }; + }); + cy.get('@dashboardCard').find('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { + if ($el.text().includes('Cypress_BrA')) { + cy.wrap($el).find('svg[data-icon="edit"]').clickAndWait({force:true}); + }; + }); + cy.get('[class="ant-modal-content"] input').filter(':visible').clear().type('Cypress_BrB'); + cy.get(`[class="ant-modal-content"] input[value="Cypress_BrB"]`).should('exist'); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1, true/*beVisible*/); + + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Biospecimen Requests')) { + cy.wrap($el).as('dashboardCard'); + }; + }); + cy.get('@dashboardCard').contains('Cypress_BrB').should('exist'); + cy.get('@dashboardCard').contains('Cypress_BrA').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Widgets/CavaticaProjects_1.cy.ts b/cypress/e2e/Widgets/CavaticaProjects_1.cy.ts new file mode 100644 index 00000000..10339095 --- /dev/null +++ b/cypress/e2e/Widgets/CavaticaProjects_1.cy.ts @@ -0,0 +1,38 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Cavatica Projects (déconnecté)', () => { + it('Vérifier les informations affichées - Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Cavatica Projects')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('[class="ant-popover-title"]').contains('CAVATICA Compute Cloud Platform').should('exist'); + cy.get('[class="ant-popover-inner-content"]').contains('CAVATICA is a cloud-based data analysis platform where data, results, and workflows are shared among the world’s research community.').should('exist'); + }); + + it('Valider les liens disponibles - Read more du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Cavatica Projects')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href="https://www.cavatica.org/"]').contains('Read more').should('exist'); + }); + + it('Vérifier les informations affichées - Carte', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Cavatica Projects')) { + cy.wrap($el).find('[class*="Gridcard_contentWrapper"]').as('gridCard'); + } + }); + cy.get('@gridCard').contains('To analyze INCLUDE data on the cloud, connect to Cavatica.').should('exist'); + cy.get('@gridCard').find('button').contains('Connect').should('exist'); + }); +}); diff --git a/cypress/e2e/Widgets/CavaticaProjects.cy.ts b/cypress/e2e/Widgets/CavaticaProjects_2.cy.ts similarity index 55% rename from cypress/e2e/Widgets/CavaticaProjects.cy.ts rename to cypress/e2e/Widgets/CavaticaProjects_2.cy.ts index 63fc4a86..2c641794 100644 --- a/cypress/e2e/Widgets/CavaticaProjects.cy.ts +++ b/cypress/e2e/Widgets/CavaticaProjects_2.cy.ts @@ -3,76 +3,38 @@ import '../../support/commands'; beforeEach(() => { cy.login(); -}); - -describe('Page Dashboard - Widget Cavatica Projects (déconnecté)', () => { - beforeEach(() => { - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Cavatica Projects')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('[class="ant-popover-title"]').contains('CAVATICA Compute Cloud Platform').should('exist'); - cy.get('[class="ant-popover-inner-content"]').contains('CAVATICA is a cloud-based data analysis platform where data, results, and workflows are shared among the world’s research community.').should('exist'); - }); - - it('Valider les liens disponibles - Read more du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Cavatica Projects')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href="https://www.cavatica.org/"]').contains('Read more').should('exist'); - }); + 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 - Carte', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Cavatica Projects')) { - cy.wrap($el).find('[class*="Gridcard_contentWrapper"]').as('gridCard'); - } - }); - cy.get('@gridCard').contains('To analyze INCLUDE data on the cloud, connect to Cavatica.').should('exist'); - cy.get('@gridCard').find('button').contains('Connect').should('exist'); - }); + cy.visitDashboard(); + cy.wait('@cavaticaAuthenticated'); + cy.wait('@cavaticaProjects'); }); describe('Page Dashboard - Widget Cavatica Projects (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.visitDashboard(); - cy.wait('@cavaticaAuthenticated'); - cy.wait('@cavaticaProjects'); - }); - it('Vérifier les informations affichées - Header', () => { cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { if ($el.text().includes('Cavatica Projects')) { diff --git a/cypress/e2e/Widgets/SavedFilters.cy.ts b/cypress/e2e/Widgets/SavedFilters.cy.ts deleted file mode 100644 index f3529103..00000000 --- a/cypress/e2e/Widgets/SavedFilters.cy.ts +++ /dev/null @@ -1,101 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page Dashboard - Widget Saved Filters', () => { - beforeEach(() => { - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Saved Filters')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('[class="ant-popover-title"]').contains('Managing saved filters').should('exist'); - cy.get('[class="ant-popover-inner-content"]').contains('A saved filter is a virtual query created by applying one or more filters to a data set. They can be saved and revisited for later use. You can create and manage saved filters from the query builder at the top of the ').should('exist'); - }); - - it('Valider les liens disponibles - Data Exploration du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Saved Filters')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href]').contains('Data Exploration').clickAndWait({force: true}); - cy.get('[class*="DataExploration_title"]').should('exist'); - }); - - it('Valider les liens disponibles - Variants Exploration du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Saved Filters')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href]').contains('Variants Exploration').clickAndWait({force: true}); - cy.get('[class*="PageContent_pageHeaderTitle"]').contains('Variants Exploration').should('exist'); - }); -}); - -describe('Page Dashboard - Widget Saved Filters', () => { - beforeEach(() => { - cy.visitDataExploration('participants'); - cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); - cy.createFilterIfNotExists('Cypress_FB'); - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Nom', () => { - cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FB').should('exist'); - }); - - it('Vérifier les informations affichées - Stamp', () => { - cy.get('[class*="SavedFilters_setTabs"]').contains('Last saved:').should('exist'); - cy.get('[class*="SavedFilters_setTabs"]').contains(' ago').should('exist'); - }); - - it('Valider les liens disponibles - Nom', () => { - cy.get('[class*="SavedFilters_setTabs"] [data-node-key="variants"]').clickAndWait({force: true}); - cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress Variant Type Filter').clickAndWait({force: true}); - cy.get('[class*="PageContent_pageHeaderTitle"]').contains('Variants Exploration').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant Type').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('SNV').should('exist'); - }); - - it('Valider les liens disponibles - Bouton Delete', () => { - cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { - if ($el.text().includes('Cypress_FB')) { - cy.wrap($el).find('svg[data-icon="delete"]').clickAndWait({force:true}); - } - }); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'DELETE', '**/saved-filters/**', 1); - cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FB').should('not.exist'); - }); -}); - -describe('Page Dashboard - Widget Saved Filters', () => { - beforeEach(() => { - cy.visitDataExploration('participants'); - cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); - cy.createFilterIfNotExists('Cypress_FA'); - cy.deleteFilterIfExists('Cypress_FB'); - cy.visitDashboard(); - }); - - it('Valider les liens disponibles - Bouton Edit', () => { - cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { - if ($el.text().includes('Cypress_FA')) { - cy.wrap($el).find('svg[data-icon="edit"]').clickAndWait({force:true}); - } - }); - cy.get('[class="ant-modal-content"] input').filter(':visible').clear().type('Cypress_FB'); - cy.get(`[class="ant-modal-content"] input[value="Cypress_FB"]`).should('exist'); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/saved-filters', 1, true/*beVisible*/); - cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FB').should('exist'); - cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FA').should('not.exist'); - }); -}); diff --git a/cypress/e2e/Widgets/SavedFilters_1.cy.ts b/cypress/e2e/Widgets/SavedFilters_1.cy.ts new file mode 100644 index 00000000..4102d99f --- /dev/null +++ b/cypress/e2e/Widgets/SavedFilters_1.cy.ts @@ -0,0 +1,39 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Saved Filters', () => { + it('Vérifier les informations affichées - Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Saved Filters')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('[class="ant-popover-title"]').contains('Managing saved filters').should('exist'); + cy.get('[class="ant-popover-inner-content"]').contains('A saved filter is a virtual query created by applying one or more filters to a data set. They can be saved and revisited for later use. You can create and manage saved filters from the query builder at the top of the ').should('exist'); + }); + + it('Valider les liens disponibles - Data Exploration du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Saved Filters')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href]').contains('Data Exploration').clickAndWait({force: true}); + cy.get('[class*="DataExploration_title"]').should('exist'); + }); + + it('Valider les liens disponibles - Variants Exploration du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Saved Filters')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href]').contains('Variants Exploration').clickAndWait({force: true}); + cy.get('[class*="PageContent_pageHeaderTitle"]').contains('Variants Exploration').should('exist'); + }); +}); diff --git a/cypress/e2e/Widgets/SavedFilters_2.cy.ts b/cypress/e2e/Widgets/SavedFilters_2.cy.ts new file mode 100644 index 00000000..851db16f --- /dev/null +++ b/cypress/e2e/Widgets/SavedFilters_2.cy.ts @@ -0,0 +1,39 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.createFilterIfNotExists('Cypress_FB'); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Saved Filters', () => { + it('Vérifier les informations affichées - Nom', () => { + cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FB').should('exist'); + }); + + it('Vérifier les informations affichées - Stamp', () => { + cy.get('[class*="SavedFilters_setTabs"]').contains('Last saved:').should('exist'); + cy.get('[class*="SavedFilters_setTabs"]').contains(' ago').should('exist'); + }); + + it('Valider les liens disponibles - Nom', () => { + cy.get('[class*="SavedFilters_setTabs"] [data-node-key="variants"]').clickAndWait({force: true}); + cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress Variant Type Filter').clickAndWait({force: true}); + cy.get('[class*="PageContent_pageHeaderTitle"]').contains('Variants Exploration').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant Type').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('SNV').should('exist'); + }); + + it('Valider les liens disponibles - Bouton Delete', () => { + cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { + if ($el.text().includes('Cypress_FB')) { + cy.wrap($el).find('svg[data-icon="delete"]').clickAndWait({force:true}); + } + }); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'DELETE', '**/saved-filters/**', 1); + cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FB').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Widgets/SavedFilters_3.cy.ts b/cypress/e2e/Widgets/SavedFilters_3.cy.ts new file mode 100644 index 00000000..a573d2bc --- /dev/null +++ b/cypress/e2e/Widgets/SavedFilters_3.cy.ts @@ -0,0 +1,26 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[id="query-builder-header-tools"] [data-icon="plus"]').clickAndWait({force: true}); + cy.createFilterIfNotExists('Cypress_FA'); + cy.deleteFilterIfExists('Cypress_FB'); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Saved Filters', () => { + it('Valider les liens disponibles - Bouton Edit', () => { + cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { + if ($el.text().includes('Cypress_FA')) { + cy.wrap($el).find('svg[data-icon="edit"]').clickAndWait({force:true}); + } + }); + cy.get('[class="ant-modal-content"] input').filter(':visible').clear().type('Cypress_FB'); + cy.get(`[class="ant-modal-content"] input[value="Cypress_FB"]`).should('exist'); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/saved-filters', 1, true/*beVisible*/); + cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FB').should('exist'); + cy.get('[class*="SavedFilters_setTabs"]').contains('Cypress_FA').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Widgets/SavedSets.cy.ts b/cypress/e2e/Widgets/SavedSets.cy.ts deleted file mode 100644 index 725f80a1..00000000 --- a/cypress/e2e/Widgets/SavedSets.cy.ts +++ /dev/null @@ -1,115 +0,0 @@ -/// -import '../../support/commands'; - -beforeEach(() => { - cy.login(); -}); - -describe('Page Dashboard - Widget Saved Sets', () => { - beforeEach(() => { - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Saved Sets')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('[class="ant-popover-title"]').contains('Managing saved sets').should('exist'); - cy.get('[class="ant-popover-inner-content"]').contains('A saved set is a collection of one or more entity IDs which can be saved and revisited for later use. You can create saved sets at the top of the table of results in the ').should('exist'); - }); - - it('Valider les liens disponibles - Data Exploration du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Saved Sets')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href]').contains('Data Exploration').clickAndWait({force: true}); - cy.get('[class*="DataExploration_title"]').should('exist'); - }); - - it('Valider les liens disponibles - Variants Exploration du Tooltip', () => { - cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { - if ($el.text().includes('Saved Sets')) { - cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); - } - }); - cy.get('a[href]').contains('Variants Exploration').clickAndWait({force: true}); - cy.get('[class*="PageContent_pageHeaderTitle"]').contains('Variants Exploration').should('exist'); - }); -}); - -describe('Page Dashboard - Widget Saved Sets', () => { - beforeEach(() => { - cy.visitDataExploration('participants'); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - cy.createSetIfNotExists('Cypress_SB', 0); - cy.visitDashboard(); - }); - - it('Vérifier les informations affichées - Nom', () => { - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SB').should('exist'); - }); - - it('Vérifier les informations affichées - Stamp', () => { - cy.get('[class*="SavedSets_setTabs"]').contains('Last saved:').should('exist'); - cy.get('[class*="SavedSets_setTabs"]').contains(' ago').should('exist'); - }); - - it('Valider les liens disponibles - Nom', () => { - cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress Biospecimens').clickAndWait({force: true}); - cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Biospecimen').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress Biospecimens').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress Data Files').clickAndWait({force: true}); - cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress Data Files').should('exist'); - - cy.visitDashboard(); - cy.get('[class*="SavedSets_setTabs"] [data-node-key="variants"]').clickAndWait({force: true}); - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress Variants').clickAndWait({force: true}); - cy.get('[class*="VariantsTable_variantTabWrapper"]').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); - cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress Variants').should('exist'); - }); - - it('Valider les liens disponibles - Bouton Delete', () => { - cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { - if ($el.text().includes('Cypress_SB')) { - cy.wrap($el).find('svg[data-icon="delete"]').clickAndWait({force:true}); - } - }); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'DELETE', '**/sets/**', 1); - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SB').should('not.exist'); - }); -}); - -describe('Page Dashboard - Widget Saved Sets', () => { - beforeEach(() => { - cy.visitDataExploration('participants'); - cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); - cy.createSetIfNotExists('Cypress_SA', 0); - cy.deleteSetIfExists('participants', 'Cypress_SB'); - cy.visitDashboard(); - }); - - it('Valider les liens disponibles - Bouton Edit', () => { - cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { - if ($el.text().includes('Cypress_SA')) { - cy.wrap($el).find('svg[data-icon="edit"]').clickAndWait({force:true}); - } - }); - cy.get('[class="ant-modal-content"] input').filter(':visible').clear().type('Cypress_SB'); - cy.get('[class="ant-modal-content"] input[value="Cypress_SB"]').should('exist'); - cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1, true/*beVisible*/); - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SB').should('exist'); - cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SA').should('not.exist'); - }); -}); diff --git a/cypress/e2e/Widgets/SavedSets_1.cy.ts b/cypress/e2e/Widgets/SavedSets_1.cy.ts new file mode 100644 index 00000000..60102eb7 --- /dev/null +++ b/cypress/e2e/Widgets/SavedSets_1.cy.ts @@ -0,0 +1,39 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Saved Sets', () => { + it('Vérifier les informations affichées - Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Saved Sets')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('[class="ant-popover-title"]').contains('Managing saved sets').should('exist'); + cy.get('[class="ant-popover-inner-content"]').contains('A saved set is a collection of one or more entity IDs which can be saved and revisited for later use. You can create saved sets at the top of the table of results in the ').should('exist'); + }); + + it('Valider les liens disponibles - Data Exploration du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Saved Sets')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href]').contains('Data Exploration').clickAndWait({force: true}); + cy.get('[class*="DataExploration_title"]').should('exist'); + }); + + it('Valider les liens disponibles - Variants Exploration du Tooltip', () => { + cy.get('[class*="DashboardCards_dashboardCard"]').each(($el: JQuery) => { + if ($el.text().includes('Saved Sets')) { + cy.wrap($el).find('[class*="CardHeader_infoIcon"]').trigger('mouseover', {eventConstructor: 'MouseEvent', force: true}); + } + }); + cy.get('a[href]').contains('Variants Exploration').clickAndWait({force: true}); + cy.get('[class*="PageContent_pageHeaderTitle"]').contains('Variants Exploration').should('exist'); + }); +}); diff --git a/cypress/e2e/Widgets/SavedSets_2.cy.ts b/cypress/e2e/Widgets/SavedSets_2.cy.ts new file mode 100644 index 00000000..29d6cba0 --- /dev/null +++ b/cypress/e2e/Widgets/SavedSets_2.cy.ts @@ -0,0 +1,53 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); + cy.createSetIfNotExists('Cypress_SB', 0); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Saved Sets', () => { + it('Vérifier les informations affichées - Nom', () => { + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SB').should('exist'); + }); + + it('Vérifier les informations affichées - Stamp', () => { + cy.get('[class*="SavedSets_setTabs"]').contains('Last saved:').should('exist'); + cy.get('[class*="SavedSets_setTabs"]').contains(' ago').should('exist'); + }); + + it('Valider les liens disponibles - Nom', () => { + cy.get('[class*="SavedSets_setTabs"] [data-node-key="biospecimen"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress Biospecimens').clickAndWait({force: true}); + cy.get('[class*="Biospecimens_biospecimenTabWrapper"]').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Biospecimen').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress Biospecimens').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="files"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress Data Files').clickAndWait({force: true}); + cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('File ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress Data Files').should('exist'); + + cy.visitDashboard(); + cy.get('[class*="SavedSets_setTabs"] [data-node-key="variants"]').clickAndWait({force: true}); + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress Variants').clickAndWait({force: true}); + cy.get('[class*="VariantsTable_variantTabWrapper"]').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Variant ID').should('exist'); + cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('Cypress Variants').should('exist'); + }); + + it('Valider les liens disponibles - Bouton Delete', () => { + cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { + if ($el.text().includes('Cypress_SB')) { + cy.wrap($el).find('svg[data-icon="delete"]').clickAndWait({force:true}); + } + }); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-dangerous"]', 'DELETE', '**/sets/**', 1); + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SB').should('not.exist'); + }); +}); diff --git a/cypress/e2e/Widgets/SavedSets_3.cy.ts b/cypress/e2e/Widgets/SavedSets_3.cy.ts new file mode 100644 index 00000000..cdbcf6f0 --- /dev/null +++ b/cypress/e2e/Widgets/SavedSets_3.cy.ts @@ -0,0 +1,26 @@ +/// +import '../../support/commands'; + +beforeEach(() => { + cy.login(); + cy.visitDataExploration('participants'); + cy.get('[data-cy="SidebarMenuItem_Participant"]').clickAndWait({force: true}); + cy.createSetIfNotExists('Cypress_SA', 0); + cy.deleteSetIfExists('participants', 'Cypress_SB'); + cy.visitDashboard(); +}); + +describe('Page Dashboard - Widget Saved Sets', () => { + it('Valider les liens disponibles - Bouton Edit', () => { + cy.get('[class*="ListItemWithActions_fuiListItemWithActions"]').each(($el: JQuery) => { + if ($el.text().includes('Cypress_SA')) { + cy.wrap($el).find('svg[data-icon="edit"]').clickAndWait({force:true}); + } + }); + cy.get('[class="ant-modal-content"] input').filter(':visible').clear().type('Cypress_SB'); + cy.get('[class="ant-modal-content"] input[value="Cypress_SB"]').should('exist'); + cy.clickAndIntercept('[class="ant-modal-content"] button[class*="ant-btn-primary"]', 'PUT', '**/sets/**', 1, true/*beVisible*/); + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SB').should('exist'); + cy.get('[class*="SavedSets_setTabs"]').contains('Cypress_SA').should('not.exist'); + }); +});