Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: SKFP-1329 Adjust Cypress tests related to last modifications #4152

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 38 additions & 15 deletions cypress/e2e/Colonnes/TableauBiospecimens.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,95 +59,118 @@ describe('Page Data Exploration (Biospecimens) - Colonnes du tableau', () => {
cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(10)
.should('not.have.class', 'ant-table-column-has-sorters')
.contains('Histological Diagnosis (MONDO)').should('exist');
.contains('Tumor Status').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(11)
.should('not.have.class', 'ant-table-column-has-sorters')
.contains('Sample Availability').should('exist');
.contains('Histological Diagnosis (MONDO)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(12)
.should('not.have.class', 'ant-table-column-has-sorters')
.contains('Sample Availability').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(13)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Files').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Anatomical Site (NCIT)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(13)
.find('div[class="ant-space-item"]').eq(14)
.contains('Anatomical Site (NCIT)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Anatomical Site (Source Text)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(14)
.find('div[class="ant-space-item"]').eq(15)
.contains('Anatomical Site (Source Text)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Histological Diagnosis (NCIT)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(15)
.find('div[class="ant-space-item"]').eq(16)
.contains('Histological Diagnosis (NCIT)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Histological Diagnosis (Source Text)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(16)
.find('div[class="ant-space-item"]').eq(17)
.contains('Histological Diagnosis (Source Text)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Tumor Location (Source Text)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(17)
.find('div[class="ant-space-item"]').eq(18)
.contains('Tumor Location (Source Text)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Consent Code (dbGaP)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(18)
.find('div[class="ant-space-item"]').eq(19)
.contains('Consent Code (dbGaP)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Consent Type').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(19)
.find('div[class="ant-space-item"]').eq(20)
.contains('Consent Type').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Preservation Method').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(21)
.contains('Preservation Method').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Method of Sample Procurement').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(20)
.find('div[class="ant-space-item"]').eq(22)
.contains('Method of Sample Procurement').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Tumor Descriptor (Source Text)').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(21)
.find('div[class="ant-space-item"]').eq(23)
.contains('Tumor Descriptor (Source Text)').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Paired Normal Sample').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(24)
.contains('Paired Normal Sample').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(22)
.find('div[class="ant-space-item"]').eq(25)
.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(23)
.find('div[class="ant-space-item"]').eq(26)
.contains('Volume Unit').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('External Participant ID').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(24)
.find('div[class="ant-space-item"]').eq(27)
.contains('External Participant ID').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('External Sample ID').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(25)
.find('div[class="ant-space-item"]').eq(28)
.contains('External Sample ID').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('External Collection ID').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(29)
.contains('External Collection ID').should('exist');
});

it('Masquer une colonne affichée', () => {
Expand Down
111 changes: 68 additions & 43 deletions cypress/e2e/Colonnes/TableauFiles.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,113 +5,139 @@ beforeEach(() => {
cy.login();
});

describe('Page Data Exploration (Files) - Colonnes du tableau', () => {
describe('Page Data Exploration (Data 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)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(1)
.should('not.have.class', 'ant-table-column-has-sorters')
.find('span[class*="anticon"]')
.should('have.class', 'anticon-lock');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(1)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(0)
.contains('File Authorization').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(2)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(2)
.should('not.have.class', 'ant-table-column-has-sorters')
.find('span[class*="anticon"]')
.should('have.class', 'anticon-safety');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(2)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(1)
.contains('Data Access').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(3)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(3)
.should('have.class', 'ant-table-column-has-sorters')
.contains('File ID').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(4)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(4)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Study').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(5)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(5)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Data Category').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(6)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(6)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Data Type').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(7)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(7)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Experimental Strategy').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(8)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(8)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Format').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(9)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(9)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Size').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(10)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(10)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Participants').should('exist');

cy.get('thead[class="ant-table-thead"]')
.find('th[class*="ant-table-cell"]').eq(11)
cy.get('thead[class="ant-table-thead"] th[class*="ant-table-cell"]').eq(11)
.should('have.class', 'ant-table-column-has-sorters')
.contains('Biospecimens').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('File Name').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(12)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(11)
.contains('File Name').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Platform').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(13)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(12)
.contains('Platform').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Repository').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(14)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(13)
.contains('Repository').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('ACL').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(15)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(14)
.contains('ACL').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Access URL').should('not.exist');
cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').eq(16)
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(15)
.contains('Access URL').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Flywheel').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(16)
.contains('Flywheel').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Modality').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(17)
.contains('Modality').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Sequence Type').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(18)
.contains('Sequence Type').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Technique').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(19)
.contains('Technique').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Body Part').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(20)
.contains('Body Part').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Field Str.').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(21)
.contains('Field Str.').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Manufacturer').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(22)
.contains('Manufacturer').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Device Model').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(23)
.contains('Device Model').should('exist');

cy.get('thead[class="ant-table-thead"]')
.contains('Device ID').should('not.exist');
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]').eq(24)
.contains('Device ID').should('exist');
});

it('Masquer une colonne affichée', () => {
cy.get('thead[class="ant-table-thead"]')
.contains('Study').should('exist');

cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').contains('Study')
.find('[type="checkbox"]').uncheck({force: true});
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]')
.contains('Study').find('[type="checkbox"]').uncheck({force: true});

cy.get('thead[class="ant-table-thead"]')
.contains('Study').should('not.exist');
Expand All @@ -121,9 +147,8 @@ describe('Page Data Exploration (Files) - Colonnes du tableau', () => {
cy.get('thead[class="ant-table-thead"]')
.contains('File Name').should('not.exist');

cy.get('div[class="ant-popover-inner"]')
.find('div[class="ant-space-item"]').contains('File Name')
.find('[type="checkbox"]').check({force: true});
cy.get('[class="ant-popover-inner"] [class*="ProTablePopoverColumnListWrapper"] [class="ant-space-item"]')
.contains('File Name').find('[type="checkbox"]').check({force: true});

cy.get('thead[class="ant-table-thead"]')
.contains('File Name').should('exist');
Expand Down
Loading
Loading