From 31edf5a2230e58c9a792f96e29f34749ca5978d4 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Wed, 24 Jul 2024 16:45:22 -0700 Subject: [PATCH 01/33] feat: add fixture data for parent tree step --- frontend/cypress/fixtures/aclass-reg-form.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/cypress/fixtures/aclass-reg-form.json b/frontend/cypress/fixtures/aclass-reg-form.json index bc034b4e2..1b6facbfd 100644 --- a/frontend/cypress/fixtures/aclass-reg-form.json +++ b/frontend/cypress/fixtures/aclass-reg-form.json @@ -58,5 +58,18 @@ "agencyValidationMsg": "Agency validation failed. Please retry verification", "locationErrorMsg": "This location code is not valid for the selected agency, please enter a valid one or change the agency", "invalidDateErrorMsg": "Please enter a valid date" + }, + "parentTree": { + "parentTreeTitle": "Cone and pollen count and SMP data", + "parentTreeSubtitle": "Enter cone and pollen count (*required), SMP success on parent and SMP mix information", + "coneTitle": "Cone and pollen count", + "coneSubtitle": "Enter the estimative of Cone and pollen count for the orchard's seedlot (*required)", + "smpSuccessTitle": "SMP success on parent", + "smpSuccessSubtitle": "Enter the estimative of SMP success for the orchard's seedlot", + "calculationSMPTitle": "Calculation of SMP mix", + "calculationSMPSubtitle": "Enter the estimative volume of SMP mix used for each clone", + "smpSuccessCheckboxText": "Enter the same SMP success on parent or Non-orchard pollen contaminant to all parent trees", + "coneErrorMsg": "Invalid cone count entries", + "pollenErrorMsg": "Invalid pollen count entries" } } From f210d10285d113f801618d92251bc84a306b487c Mon Sep 17 00:00:00 2001 From: Nisarg Date: Wed, 24 Jul 2024 16:45:50 -0700 Subject: [PATCH 02/33] feat: create parent tree cypress test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts new file mode 100644 index 000000000..3ce3c285d --- /dev/null +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -0,0 +1,46 @@ +import { TYPE_DELAY } from '../../constants'; +import prefix from '../../../src/styles/classPrefix'; +import { SeedlotRegFixtureType } from '../../definitions'; + +describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and Pollen count)', () => { + let regFormData: { + parentTree: { + parentTreeTitle: string; + parentTreeSubtitle: string; + coneTitle: string; + coneSubtitle: string; + smpSuccessTitle: string; + smpSuccessSubtitle: string; + calculationSMPTitle: string; + calculationSMPSubtitle: string; + smpSuccessCheckboxText: string; + coneErrorMsg: string; + pollenErrorMsg: string; + } + }; + + let seedlotNum: string; + const speciesKey = 'pli'; + let seedlotData: SeedlotRegFixtureType; + + beforeEach(() => { + // Login + cy.login(); + cy.fixture('aclass-reg-form').then((fData) => { + regFormData = fData; + }); + + cy.fixture('aclass-seedlot').then((fData) => { + seedlotData = fData; + cy.task('getData', fData[speciesKey].species).then((sNumber) => { + seedlotNum = sNumber as string; + const url = `/seedlots/a-class-registration/${seedlotNum}/?step=5`; + cy.visit(url); + cy.url().should('contains', url); + }); + }); + }); + + it('Page title and subtitles', () => { + }); +}); From 7dee5761afca95c595bb2eaee35738c6976d09aa Mon Sep 17 00:00:00 2001 From: Nisarg Date: Wed, 24 Jul 2024 16:46:07 -0700 Subject: [PATCH 03/33] feat: add parent tree cypress test --- frontend/cypress.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/cypress.config.ts b/frontend/cypress.config.ts index a33ff2d69..e1917d8de 100644 --- a/frontend/cypress.config.ts +++ b/frontend/cypress.config.ts @@ -28,7 +28,8 @@ export default defineConfig({ '**/a-class-seedlot-reg-form-collection-interim.cy.ts', '**/a-class-seedlot-reg-form-ownership.cy.ts', '**/a-class-seedlot-reg-form-orchard.cy.ts', - '**/a-class-seedlot-reg-form-extraction.cy.ts' + '**/a-class-seedlot-reg-form-extraction.cy.ts', + '**/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts' ], chromeWebSecurity: false, retries: { From b099f39be43c0ea07a6ff9a41ac48d5ec729ffba Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 25 Jul 2024 12:52:17 -0700 Subject: [PATCH 04/33] feat: add error msg --- frontend/cypress/fixtures/aclass-reg-form.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/fixtures/aclass-reg-form.json b/frontend/cypress/fixtures/aclass-reg-form.json index 1b6facbfd..2d8f22524 100644 --- a/frontend/cypress/fixtures/aclass-reg-form.json +++ b/frontend/cypress/fixtures/aclass-reg-form.json @@ -70,6 +70,13 @@ "calculationSMPSubtitle": "Enter the estimative volume of SMP mix used for each clone", "smpSuccessCheckboxText": "Enter the same SMP success on parent or Non-orchard pollen contaminant to all parent trees", "coneErrorMsg": "Invalid cone count entries", - "pollenErrorMsg": "Invalid pollen count entries" + "pollenErrorMsg": "Invalid pollen count entries", + "conePollenErrorMsg": "Invalid cone count and pollen count entries", + "smpSuccessErrorMsg": "Invalid SMP success on parent (%) entries", + "nonOrchardErrorMsg": "Invalid non-orchard pollen contam. (%) entries", + "smpSuccessNonOrchardErrorMsg": "Invalid SMP success on parent (%) and non-orchard pollen contam. (%) entries", + "parentTreeErrorMsg": "Invalid parent tree number entries", + "voulmeErrorMsg": "Invalid volume (ml) entries", + "parentTreeVolumeErrorMsg": "Invalid SMP success on parent (%) and non-orchard pollen contam. (%) entries" } } From 8e510c9e47e48b09fa0816ee130014324a923ca3 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 25 Jul 2024 15:17:59 -0700 Subject: [PATCH 05/33] feat: add test of title and invalid entries error msg --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 107 ++++++++++++++++-- 1 file changed, 100 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 3ce3c285d..246a3c255 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -5,17 +5,13 @@ import { SeedlotRegFixtureType } from '../../definitions'; describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and Pollen count)', () => { let regFormData: { parentTree: { - parentTreeTitle: string; - parentTreeSubtitle: string; + title: string; + subtitle: string; coneTitle: string; coneSubtitle: string; - smpSuccessTitle: string; - smpSuccessSubtitle: string; - calculationSMPTitle: string; - calculationSMPSubtitle: string; - smpSuccessCheckboxText: string; coneErrorMsg: string; pollenErrorMsg: string; + conePollenErrorMsg: string; } }; @@ -42,5 +38,102 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); it('Page title and subtitles', () => { + cy.get('.title-row') + .find('h2') + .should('have.text', regFormData.parentTree.title); + + cy.get('.subtitle-section') + .should('have.text', regFormData.parentTree.subtitle); + + cy.get('.parent-tree-step-table-container') + .find('h4') + .should('have.text', regFormData.parentTree.coneTitle); + + cy.get('.parent-tree-step-table-container') + .find(`p.${prefix}--data-table-header__description`) + .should('have.text', regFormData.parentTree.coneSubtitle); + }); + + it('Cone and pollen count table entries', () => { + // Check error message for negative Cone count + cy.get('#212-coneCount-value-input') + .type('-1') + .blur(); + + cy.get(`.${prefix}--actionable-notification--error`) + .should('be.visible'); + + cy.get(`.${prefix}--actionable-notification--error`) + .find(`.${prefix}--actionable-notification__title`) + .as('errorDialog') + .should('have.text', regFormData.parentTree.coneErrorMsg); + + cy.get('.subtitle-section') + .should('have.text', regFormData.parentTree.subtitle); + + // Check error message for Cone count > 10000000000 + cy.get('#212-coneCount-value-input') + .clear() + .type('10000000001') + .blur(); + + cy.get('@errorDialog') + .should('have.text', regFormData.parentTree.coneErrorMsg); + + // Check error message for Cone count value > 10 decimal places + cy.get('#212-coneCount-value-input') + .clear() + .type('0.00000000001') + .blur(); + + cy.get('@errorDialog') + .should('have.text', regFormData.parentTree.coneErrorMsg); + + // Check no error message for positive Cone count + cy.get('#212-coneCount-value-input') + .clear() + .type('1') + .blur(); + + cy.get(`.${prefix}--actionable-notification--error`) + .should('not.exist'); + + // Check error message for negative Pollen count + cy.get('#212-pollenCount-value-input') + .type('-1') + .blur(); + + cy.get(`.${prefix}--actionable-notification--error`) + .should('be.visible'); + + cy.get('@errorDialog') + .should('have.text', regFormData.parentTree.pollenErrorMsg); + + // Check error message for Pollen count > 10000000000 + cy.get('#212-pollenCount-value-input') + .clear() + .type('10000000001') + .blur(); + + cy.get('@errorDialog') + .should('have.text', regFormData.parentTree.coneErrorMsg); + + // Check error message for Pollen count value > 10 decimal places + cy.get('#212-pollenCount-value-input') + .clear() + .type('0.00000000001') + .blur(); + + cy.get('@errorDialog') + .should('have.text', regFormData.parentTree.coneErrorMsg); + + // Check error message for negative Cone count and negative Pollen count + cy.get('#212-coneCount-value-input') + .clear() + .type('-1') + .blur(); + + cy.get('@errorDialog') + .should('have.text', regFormData.parentTree.conePollenErrorMsg); }); }); From 5ac4ccf7ffa1ce6abd7d98adc22310f8230a6b7c Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 25 Jul 2024 15:18:18 -0700 Subject: [PATCH 06/33] fix: change error name --- frontend/cypress/fixtures/aclass-reg-form.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/fixtures/aclass-reg-form.json b/frontend/cypress/fixtures/aclass-reg-form.json index 2d8f22524..cfcb0e966 100644 --- a/frontend/cypress/fixtures/aclass-reg-form.json +++ b/frontend/cypress/fixtures/aclass-reg-form.json @@ -60,8 +60,8 @@ "invalidDateErrorMsg": "Please enter a valid date" }, "parentTree": { - "parentTreeTitle": "Cone and pollen count and SMP data", - "parentTreeSubtitle": "Enter cone and pollen count (*required), SMP success on parent and SMP mix information", + "title": "Cone and pollen count and SMP data", + "subtitle": "Enter cone and pollen count (*required), SMP success on parent and SMP mix information", "coneTitle": "Cone and pollen count", "coneSubtitle": "Enter the estimative of Cone and pollen count for the orchard's seedlot (*required)", "smpSuccessTitle": "SMP success on parent", From bc0d4a5e8829ca964536462dc0f406a69ceea0b4 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Fri, 26 Jul 2024 13:29:27 -0700 Subject: [PATCH 07/33] feat: add 'More Options' button test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 246a3c255..0627892ab 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -135,5 +135,74 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get('@errorDialog') .should('have.text', regFormData.parentTree.conePollenErrorMsg); + + // Empty the Pollen count and Cone count inputs + cy.get('#212-pollenCount-value-input') + .clear() + .blur(); + + cy.get('#212-coneCount-value-input') + .clear() + .blur(); + }); + + it('Check \'More Options\' button functionality', () => { + // Check Download file option + cy.get(`.${prefix}--toolbar-content > span`) + .eq(1) + .find('button') + .click(); + + cy.get('ul.parent-tree-table-option-menu') + .find('li') + .contains('Download table template') + .click(); + + cy.readFile(`${Cypress.config('downloadsFolder')}/Seedlot_composition_template.csv`); + + // Enter values in Cone count and Pollen count columns of the table + cy.get('#212-coneCount-value-input') + .clear() + .type('16') + .blur(); + + cy.get('#212-pollenCount-value-input') + .clear() + .type('17') + .blur(); + + cy.get('#219-coneCount-value-input') + .clear() + .type('23') + .blur(); + + cy.get('#219-pollenCount-value-input') + .clear() + .type('28') + .blur(); + + // Click 'Clean table data' option + cy.get(`.${prefix}--toolbar-content > span`) + .eq(1) + .find('button') + .click(); + + cy.get('ul.parent-tree-table-option-menu') + .find('li') + .contains('Clean table data') + .click(); + + // Check values in Cone count and Pollen count columns of the table + cy.get('#212-coneCount-value-input') + .should('have.value', ''); + + cy.get('#212-pollenCount-value-input') + .should('have.value', ''); + + cy.get('#219-coneCount-value-input') + .should('have.value', ''); + + cy.get('#219-pollenCount-value-input') + .should('have.value', ''); }); }); From e1c8a606b362bbd6c393e43e38058e8a254ae426 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Fri, 26 Jul 2024 13:56:52 -0700 Subject: [PATCH 08/33] feat: add code for 'Clean table data' dialog box --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 0627892ab..02c566e23 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -151,7 +151,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get(`.${prefix}--toolbar-content > span`) .eq(1) .find('button') - .click(); + .click() + .as('clickMoreOptionsBtn'); cy.get('ul.parent-tree-table-option-menu') .find('li') @@ -182,14 +183,46 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .blur(); // Click 'Clean table data' option - cy.get(`.${prefix}--toolbar-content > span`) - .eq(1) - .find('button') - .click(); + cy.get('@clickMoreOptionsBtn'); cy.get('ul.parent-tree-table-option-menu') .find('li') .contains('Clean table data') + .click() + .as('clickCleanTableBtn'); + + cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) + .should('be.visible'); + + // Check Cancel button of 'Clean table data' dialog box + cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) + .find('button') + .contains('Cancel') + .click(); + + cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) + .should('not.exist'); + + // Check 'X' button of 'Clean table data' dialog box + cy.get('@clickMoreOptionsBtn'); + + cy.get('@clickCleanTableBtn') + + cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) + .find('button[aria-label="close"]') + .click(); + + cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) + .should('not.exist'); + + // Check 'Clean table data' button of 'Clean table data' dialog box + cy.get('@clickMoreOptionsBtn'); + + cy.get('@clickCleanTableBtn') + + cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) + .find('button') + .contains('Clean table data') .click(); // Check values in Cone count and Pollen count columns of the table From a31aada612d477c822098dc2ab4a822efe96d21e Mon Sep 17 00:00:00 2001 From: Nisarg Date: Fri, 26 Jul 2024 14:19:14 -0700 Subject: [PATCH 09/33] feat: add 'Show/hide columns' test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 02c566e23..78899485c 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -146,6 +146,71 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .blur(); }); + it('Check \'Show/hide columns\' button functionality', () => { + // Click 'Dothistroma needle blight (DFS)' checkbox + cy.get(`.${prefix}--toolbar-content > span`) + .eq(0) + .find('button') + .click() + .as('clickShowHideBtn'); + + cy.get('ul.parent-tree-table-option-menu') + .find('li') + .contains('Dothistroma needle blight (DFS)') + .click(); + + cy.get('.parent-tree-step-table-container') + .find('h4') + .click() + .as('closeShowHideDropdown'); + + cy.get('thead.table-header') + .find('#dfs') + .should('exist'); + + // Click 'Comandra blister rust (DSC)' checkbox + cy.get('@clickShowHideBtn'); + + cy.get('ul.parent-tree-table-option-menu') + .find('li') + .contains('Comandra blister rust (DSC)') + .click(); + + cy.get('@closeShowHideDropdown') + + cy.get('thead.table-header') + .find('#dsc') + .should('exist'); + + // Click 'Western gall rust (DSG)' checkbox + cy.get('@clickShowHideBtn'); + + cy.get('ul.parent-tree-table-option-menu') + .find('li') + .contains('Western gall rust (DSG)') + .click(); + + cy.get('@closeShowHideDropdown') + + cy.get('thead.table-header') + .find('#dsg') + .should('exist'); + + // Click 'Volume growth (GVO)' checkbox + cy.get('@clickShowHideBtn'); + + cy.get('ul.parent-tree-table-option-menu') + .find('li') + .contains('Volume growth (GVO)') + .click(); + + cy.get('@closeShowHideDropdown') + + cy.get('thead.table-header') + .find('#gvo') + .should('exist'); + }); + it('Check \'More Options\' button functionality', () => { // Check Download file option cy.get(`.${prefix}--toolbar-content > span`) From 0c8640ddff7d7547ff181069dd274e1b339dc50d Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 29 Jul 2024 11:22:43 -0700 Subject: [PATCH 10/33] feat: add pagination test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 78899485c..bef508ba6 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -303,4 +303,47 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get('#219-pollenCount-value-input') .should('have.value', ''); }); + + it('Pagination', () => { + const dropdownNumber = '20'; + // Number of item dropdown + cy.get(`.${prefix}--pagination__left`) + .find('select') + .as('dropdownBtn') + .select(dropdownNumber); + + // Check total number of rows are 20 + cy.get(`table.${prefix}--data-table > tbody > tr`) + .should('equal', dropdownNumber); + + // Page number dropdown + cy.get(`.${prefix}--pagination__right`) + .find(`select.${prefix}--select-input`) + .select(2); + + cy.get(`.${prefix}--pagination__left`) + .find(`.${prefix}--pagination__items-count`) + .should('include.text', '21–40'); + + cy.get(`.${prefix}--pagination__right`) + .find(`select.${prefix}--select-input`) + .select(1); + + // Forward Backward buttons + cy.get(`.${prefix}--pagination__control-buttons`) + .find(`button.${prefix}--pagination__button--forward`) + .click(); + + cy.get(`.${prefix}--pagination__right`) + .find(`select.${prefix}--select-input`) + .should('have.value', '2'); + + cy.get(`.${prefix}--pagination__control-buttons`) + .find(`button.${prefix}--pagination__button--backward`) + .click(); + + cy.get(`.${prefix}--pagination__right`) + .find(`select.${prefix}--select-input`) + .should('have.value', '1'); + }); }); From 648fe80ac8e0e975b7eb48342227677513c5fa4b Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 29 Jul 2024 11:48:36 -0700 Subject: [PATCH 11/33] feat: add accordion test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index bef508ba6..3011479ce 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -54,6 +54,45 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .should('have.text', regFormData.parentTree.coneSubtitle); }); + it('Accordion', () => { + // Check default accordion behaviour + cy.get(`.${prefix}--accordion__wrapper`) + .should('be.visible'); + + // Check closing of first accordion + cy.get(`ul.${prefix}--accordion > li`) + .eq(0) + .find(`button.${prefix}--accordion__heading`) + .click(); + + cy.get(`ul.${prefix}--accordion > li`) + .eq(0) + .find(`.${prefix}--accordion__wrapper`) + .should('not.be.visible'); + + // Check closing of second accordion + cy.get(`ul.${prefix}--accordion > li`) + .eq(1) + .find(`button.${prefix}--accordion__heading`) + .click(); + + cy.get(`ul.${prefix}--accordion > li`) + .eq(1) + .find(`.${prefix}--accordion__wrapper`) + .should('not.be.visible'); + + // Check closing of third accordion + cy.get(`ul.${prefix}--accordion > li`) + .eq(2) + .find(`button.${prefix}--accordion__heading`) + .click(); + + cy.get(`ul.${prefix}--accordion > li`) + .eq(2) + .find(`.${prefix}--accordion__wrapper`) + .should('not.be.visible'); + }); + it('Cone and pollen count table entries', () => { // Check error message for negative Cone count cy.get('#212-coneCount-value-input') From 6142e9af4bb8831d23b1686aebc71fc1e4ef1dfe Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 29 Jul 2024 12:00:58 -0700 Subject: [PATCH 12/33] feat: add 'Calculate metrics' button functionality test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 3011479ce..17d0e9d94 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -385,4 +385,41 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .find(`select.${prefix}--select-input`) .should('have.value', '1'); }); + + it('Calculate Metrics button', () => { + // Check info sections not visible in DOM + cy.get('.info-section-sub-title') + .find(`.${prefix}--col`) + .contains('Genetic worth and percent of Tested parent tree contribution') + .as('firstInfoSection') + .should('not.exist'); + + cy.get('.info-section-sub-title') + .find(`.${prefix}--col`) + .contains('Effective population size and diversity') + .as('secondInfoSection') + .should('not.exist'); + + cy.get('.info-section-sub-title') + .find(`.${prefix}--col`) + .contains('Orchard parent tree geospatial summary') + .as('thirdInfoSection') + .should('not.exist'); + + // Click 'Calculate metrics' button + cy.get('.gen-worth-cal-row') + .find('button') + .contains('Calculate metrics') + .click(); + + // Check info sections visible in DOM + cy.get('@firstInfoSection') + .should('be.visible'); + + cy.get('@secondInfoSection') + .should('be.visible'); + + cy.get('@thirdInfoSection') + .should('be.visible'); + }); }); From df095bd5e5b6de048c7f3a6ee2b191e914cd2c6c Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 29 Jul 2024 12:03:52 -0700 Subject: [PATCH 13/33] feat: remove unwanted code --- .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 17d0e9d94..95df92b8d 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -17,7 +17,6 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and let seedlotNum: string; const speciesKey = 'pli'; - let seedlotData: SeedlotRegFixtureType; beforeEach(() => { // Login @@ -27,7 +26,6 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); cy.fixture('aclass-seedlot').then((fData) => { - seedlotData = fData; cy.task('getData', fData[speciesKey].species).then((sNumber) => { seedlotNum = sNumber as string; const url = `/seedlots/a-class-registration/${seedlotNum}/?step=5`; From 0dcc525e98f7eb3aa8a6034f06171078ca162d2c Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 29 Jul 2024 14:35:03 -0700 Subject: [PATCH 14/33] fix: update for successful cypress test --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 110 ++++++++++-------- 1 file changed, 59 insertions(+), 51 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 95df92b8d..9bf475e53 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -1,6 +1,4 @@ -import { TYPE_DELAY } from '../../constants'; import prefix from '../../../src/styles/classPrefix'; -import { SeedlotRegFixtureType } from '../../definitions'; describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and Pollen count)', () => { let regFormData: { @@ -40,7 +38,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .find('h2') .should('have.text', regFormData.parentTree.title); - cy.get('.subtitle-section') + cy.get('.title-row') + .find('.subtitle-section') .should('have.text', regFormData.parentTree.subtitle); cy.get('.parent-tree-step-table-container') @@ -105,9 +104,6 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .as('errorDialog') .should('have.text', regFormData.parentTree.coneErrorMsg); - cy.get('.subtitle-section') - .should('have.text', regFormData.parentTree.subtitle); - // Check error message for Cone count > 10000000000 cy.get('#212-coneCount-value-input') .clear() @@ -153,7 +149,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .blur(); cy.get('@errorDialog') - .should('have.text', regFormData.parentTree.coneErrorMsg); + .should('have.text', regFormData.parentTree.pollenErrorMsg); // Check error message for Pollen count value > 10 decimal places cy.get('#212-pollenCount-value-input') @@ -162,7 +158,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .blur(); cy.get('@errorDialog') - .should('have.text', regFormData.parentTree.coneErrorMsg); + .should('have.text', regFormData.parentTree.pollenErrorMsg); // Check error message for negative Cone count and negative Pollen count cy.get('#212-coneCount-value-input') @@ -188,60 +184,66 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get(`.${prefix}--toolbar-content > span`) .eq(0) .find('button') - .click() - .as('clickShowHideBtn'); + .as('clickShowHideBtn') + .click(); - cy.get('ul.parent-tree-table-option-menu') + cy.get('ul.parent-tree-table-toggle-menu') .find('li') .contains('Dothistroma needle blight (DFS)') .click(); cy.get('.parent-tree-step-table-container') .find('h4') - .click() - .as('closeShowHideDropdown'); + .as('closeShowHideDropdown') + .click(); cy.get('thead.table-header') .find('#dfs') .should('exist'); // Click 'Comandra blister rust (DSC)' checkbox - cy.get('@clickShowHideBtn'); + cy.get('@clickShowHideBtn') + .click(); - cy.get('ul.parent-tree-table-option-menu') + cy.get('ul.parent-tree-table-toggle-menu') .find('li') .contains('Comandra blister rust (DSC)') .click(); cy.get('@closeShowHideDropdown') + .click(); cy.get('thead.table-header') .find('#dsc') .should('exist'); // Click 'Western gall rust (DSG)' checkbox - cy.get('@clickShowHideBtn'); + cy.get('@clickShowHideBtn') + .click(); - cy.get('ul.parent-tree-table-option-menu') + cy.get('ul.parent-tree-table-toggle-menu') .find('li') .contains('Western gall rust (DSG)') .click(); cy.get('@closeShowHideDropdown') + .click(); cy.get('thead.table-header') .find('#dsg') .should('exist'); // Click 'Volume growth (GVO)' checkbox - cy.get('@clickShowHideBtn'); + cy.get('@clickShowHideBtn') + .click(); - cy.get('ul.parent-tree-table-option-menu') + cy.get('ul.parent-tree-table-toggle-menu') .find('li') .contains('Volume growth (GVO)') .click(); cy.get('@closeShowHideDropdown') + .click(); cy.get('thead.table-header') .find('#gvo') @@ -253,8 +255,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get(`.${prefix}--toolbar-content > span`) .eq(1) .find('button') - .click() - .as('clickMoreOptionsBtn'); + .as('clickMoreOptionsBtn') + .click(); cy.get('ul.parent-tree-table-option-menu') .find('li') @@ -285,13 +287,14 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .blur(); // Click 'Clean table data' option - cy.get('@clickMoreOptionsBtn'); + cy.get('@clickMoreOptionsBtn') + .click(); cy.get('ul.parent-tree-table-option-menu') .find('li') .contains('Clean table data') - .click() - .as('clickCleanTableBtn'); + .as('clickCleanTableBtn') + .click(); cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) .should('be.visible'); @@ -303,24 +306,28 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .click(); cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) - .should('not.exist'); + .should('not.be.visible'); // Check 'X' button of 'Clean table data' dialog box - cy.get('@clickMoreOptionsBtn'); + cy.get('@clickMoreOptionsBtn') + .click(); cy.get('@clickCleanTableBtn') + .click(); cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) .find('button[aria-label="close"]') .click(); cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) - .should('not.exist'); + .should('not.be.visible'); // Check 'Clean table data' button of 'Clean table data' dialog box - cy.get('@clickMoreOptionsBtn'); + cy.get('@clickMoreOptionsBtn') + .click(); cy.get('@clickCleanTableBtn') + .click(); cy.get(`.${prefix}--modal-container[aria-label="Clean table data"]`) .find('button') @@ -341,7 +348,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .should('have.value', ''); }); - it('Pagination', () => { + it.only('Pagination', () => { const dropdownNumber = '20'; // Number of item dropdown cy.get(`.${prefix}--pagination__left`) @@ -349,14 +356,24 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .as('dropdownBtn') .select(dropdownNumber); + // Wait for the table in Step 5 to load + cy.get('#parentTreeNumber'); + + cy.get(`.${prefix}--pagination__left`) + .find(`.${prefix}--pagination__items-count`) + .should('include.text', '1–20'); + // Check total number of rows are 20 - cy.get(`table.${prefix}--data-table > tbody > tr`) - .should('equal', dropdownNumber); + cy.get(`table.${prefix}--data-table tbody`) + .find('tr') + .then(($row) => { + expect($row.length).equal(parseInt(dropdownNumber)); + }); // Page number dropdown cy.get(`.${prefix}--pagination__right`) .find(`select.${prefix}--select-input`) - .select(2); + .select('2'); cy.get(`.${prefix}--pagination__left`) .find(`.${prefix}--pagination__items-count`) @@ -364,7 +381,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get(`.${prefix}--pagination__right`) .find(`select.${prefix}--select-input`) - .select(1); + .select('1'); // Forward Backward buttons cy.get(`.${prefix}--pagination__control-buttons`) @@ -387,21 +404,6 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and it('Calculate Metrics button', () => { // Check info sections not visible in DOM cy.get('.info-section-sub-title') - .find(`.${prefix}--col`) - .contains('Genetic worth and percent of Tested parent tree contribution') - .as('firstInfoSection') - .should('not.exist'); - - cy.get('.info-section-sub-title') - .find(`.${prefix}--col`) - .contains('Effective population size and diversity') - .as('secondInfoSection') - .should('not.exist'); - - cy.get('.info-section-sub-title') - .find(`.${prefix}--col`) - .contains('Orchard parent tree geospatial summary') - .as('thirdInfoSection') .should('not.exist'); // Click 'Calculate metrics' button @@ -411,13 +413,19 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .click(); // Check info sections visible in DOM - cy.get('@firstInfoSection') + cy.get('.info-section-sub-title') + .find(`.${prefix}--col`) + .contains('Genetic worth and percent of Tested parent tree contribution') .should('be.visible'); - cy.get('@secondInfoSection') + cy.get('.info-section-sub-title') + .find(`.${prefix}--col`) + .contains('Effective population size and diversity') .should('be.visible'); - cy.get('@thirdInfoSection') + cy.get('.info-section-sub-title') + .find(`.${prefix}--col`) + .contains('Orchard parent tree geospatial summary') .should('be.visible'); }); }); From 0ade37f9b3f478377fd096e0356376634c8537c2 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 29 Jul 2024 14:35:12 -0700 Subject: [PATCH 15/33] fix: add space --- frontend/cypress/fixtures/aclass-reg-form.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/fixtures/aclass-reg-form.json b/frontend/cypress/fixtures/aclass-reg-form.json index cfcb0e966..ca2c77dbf 100644 --- a/frontend/cypress/fixtures/aclass-reg-form.json +++ b/frontend/cypress/fixtures/aclass-reg-form.json @@ -61,7 +61,7 @@ }, "parentTree": { "title": "Cone and pollen count and SMP data", - "subtitle": "Enter cone and pollen count (*required), SMP success on parent and SMP mix information", + "subtitle": "Enter cone and pollen count (*required), SMP success on parent and SMP mix information ", "coneTitle": "Cone and pollen count", "coneSubtitle": "Enter the estimative of Cone and pollen count for the orchard's seedlot (*required)", "smpSuccessTitle": "SMP success on parent", From 065967e0f18ae2a08a9696a0c598b00f9a4fc7ad Mon Sep 17 00:00:00 2001 From: Nisarg Date: Tue, 30 Jul 2024 10:49:21 -0700 Subject: [PATCH 16/33] feat: add accordion link test --- ...lass-seedlot-reg-form-parent-tree-part-1.cy.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 9bf475e53..11556d680 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -56,6 +56,21 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get(`.${prefix}--accordion__wrapper`) .should('be.visible'); + // Check template links + cy.get('ul.donwload-templates-list') + .find('li') + .contains('Download cone and pollen count and SMP success on parent template.') + .click(); + + cy.readFile(`${Cypress.config('downloadsFolder')}/Seedlot_composition_template.csv`); + + cy.get('ul.donwload-templates-list') + .find('li') + .contains('Download calculation of SMP mix template.') + .click(); + + cy.readFile(`${Cypress.config('downloadsFolder')}/SMP_Mix_Volume_template.csv`); + // Check closing of first accordion cy.get(`ul.${prefix}--accordion > li`) .eq(0) From d3217353f21ec1bd4a7f3994516751af52a93f5c Mon Sep 17 00:00:00 2001 From: Nisarg Date: Tue, 30 Jul 2024 14:35:40 -0700 Subject: [PATCH 17/33] feat: update pagination test --- .../cypress/e2e/smoke-test/my-seedlots.cy.ts | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts b/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts index e971771b8..bc95241d0 100644 --- a/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts +++ b/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts @@ -247,18 +247,41 @@ describe('My seedlots page', () => { }); }); - it('Pagination', () => { + it.only('Pagination', () => { + const dropdownNumber = '10'; // Number of item dropdown cy.get(`.${prefix}--pagination__left`) .find('select') - .as('dropdownBtn') - .select('10'); + .select(dropdownNumber); - // @ngunner15 the drop down is selected with value 10, what we need here is to verify - // that the total number of rows on this page is actually 10. - // you might be able to do that by checking the total number of under - cy.get('@dropdownBtn') - .should('have.value', '10'); + // Wait for table body to load + cy.get(`table.${prefix}--data-table tbody`) + .find('tr') + .eq(2); + + cy.get(`.${prefix}--pagination__left`) + .find(`.${prefix}--pagination__items-count`) + .should('include.text', '1–10'); + + // Check total number of rows are 10 + cy.get(`table.${prefix}--data-table tbody`) + .find('tr') + .then(($row) => { + expect($row.length).equal(parseInt(dropdownNumber)); + }); + + // Page number dropdown + cy.get(`.${prefix}--pagination__right`) + .find(`select.${prefix}--select-input`) + .select('2'); + + cy.get(`.${prefix}--pagination__left`) + .find(`.${prefix}--pagination__items-count`) + .should('include.text', '11'); + + cy.get(`.${prefix}--pagination__right`) + .find(`select.${prefix}--select-input`) + .select('1'); // Forward Backward buttons cy.get(`.${prefix}--pagination__control-buttons`) @@ -276,8 +299,6 @@ describe('My seedlots page', () => { cy.get(`.${prefix}--pagination__right`) .find(`select.${prefix}--select-input`) .should('have.value', '1'); - - // @ngunner15 Need to test the page number dropdown }); it('Select a seedlot row should redirect to its detail page', () => { From 3b6a4298f4bf24784d69c64ed9a67763f468e586 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Tue, 30 Jul 2024 14:36:06 -0700 Subject: [PATCH 18/33] fix: remove unwanted code --- .../smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 11556d680..c5377e4ae 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -368,7 +368,6 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and // Number of item dropdown cy.get(`.${prefix}--pagination__left`) .find('select') - .as('dropdownBtn') .select(dropdownNumber); // Wait for the table in Step 5 to load From 89a283631ab7884539869ba6a2ec4ab03a73f8ca Mon Sep 17 00:00:00 2001 From: Nisarg Date: Tue, 30 Jul 2024 15:02:31 -0700 Subject: [PATCH 19/33] fix: remove it.only --- frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts b/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts index bc95241d0..69ed88a02 100644 --- a/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts +++ b/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts @@ -247,7 +247,7 @@ describe('My seedlots page', () => { }); }); - it.only('Pagination', () => { + it('Pagination', () => { const dropdownNumber = '10'; // Number of item dropdown cy.get(`.${prefix}--pagination__left`) From 94dda5b04f14b21fa42668497b6a196adc5c432a Mon Sep 17 00:00:00 2001 From: Nisarg Date: Wed, 31 Jul 2024 09:10:45 -0700 Subject: [PATCH 20/33] fix: remove it.only --- .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index c5377e4ae..d98fbe3ec 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -363,7 +363,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .should('have.value', ''); }); - it.only('Pagination', () => { + it('Pagination', () => { const dropdownNumber = '20'; // Number of item dropdown cy.get(`.${prefix}--pagination__left`) From 139f3a35df46c8d694a01f2cb58c22c418cb6490 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 1 Aug 2024 11:07:19 -0700 Subject: [PATCH 21/33] feat: add upload nutton functionality --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index d98fbe3ec..b54375d94 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -361,6 +361,48 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get('#219-pollenCount-value-input') .should('have.value', ''); + + // Check upload button functionality + cy.get('button.upload-button') + .click(); + + cy.get(`.${prefix}--modal-container[aria-label="Seedlot registration"]`) + .should('be.visible'); + + cy.get('button') + .contains('Cancel') + .click(); + + cy.get(`.${prefix}--modal-container[aria-label="Seedlot registration"]`) + .should('not.be.visible'); + + // Check file upload functionality + cy.get('button.upload-button') + .click({force: true}); + + cy.get(`.${prefix}--modal-container[aria-label="Seedlot registration"]`) + .should('be.visible'); + + cy.get(`.${prefix}--file`) + .find(`input.${prefix}--file-input`) + .selectFile('cypress/fixtures/Seedlot_composition_template.csv', {force: true}); + + cy.get('button') + .contains('Import file and continue') + .click(); + + // Check values in Cone count and Pollen count columns of the table + cy.get('#212-coneCount-value-input') + .should('have.value', '1'); + + cy.get('#212-pollenCount-value-input') + .should('have.value', '46'); + + cy.get('#219-coneCount-value-input') + .should('have.value', '2'); + + cy.get('#219-pollenCount-value-input') + .should('have.value', '22'); }); it('Pagination', () => { From 115fd67664eb4df5f973990c484d634e3c419d47 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 1 Aug 2024 11:08:10 -0700 Subject: [PATCH 22/33] feat: add csv file for upload button test --- frontend/cypress/fixtures/Seedlot_composition_template.csv | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 frontend/cypress/fixtures/Seedlot_composition_template.csv diff --git a/frontend/cypress/fixtures/Seedlot_composition_template.csv b/frontend/cypress/fixtures/Seedlot_composition_template.csv new file mode 100644 index 000000000..af0f19167 --- /dev/null +++ b/frontend/cypress/fixtures/Seedlot_composition_template.csv @@ -0,0 +1,4 @@ +Parent Tree number,Cone count,Pollen count,SMP success,Pollen contamination +212,1,46,, +219,2,22,, +222,7,8,, From 3b2135b988001d389801fefbf5331bea55000d6f Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 1 Aug 2024 11:17:16 -0700 Subject: [PATCH 23/33] fix: update comments --- .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index b54375d94..a63567bd2 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -391,7 +391,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .contains('Import file and continue') .click(); - // Check values in Cone count and Pollen count columns of the table + // Compare values in Cone count and Pollen count columns of the table with the csv file cy.get('#212-coneCount-value-input') .should('have.value', '1'); @@ -412,7 +412,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .find('select') .select(dropdownNumber); - // Wait for the table in Step 5 to load + // Wait for the table to load cy.get('#parentTreeNumber'); cy.get(`.${prefix}--pagination__left`) From d5ab60ad466ce66b2d426962740ddce485c2e355 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Mon, 12 Aug 2024 14:36:12 -0700 Subject: [PATCH 24/33] fix: update --- .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 8 ++++---- frontend/cypress/fixtures/aclass-reg-form.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index a63567bd2..8c82ef1c5 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -200,7 +200,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .eq(0) .find('button') .as('clickShowHideBtn') - .click(); + .click({force: true}); cy.get('ul.parent-tree-table-toggle-menu') .find('li') @@ -218,7 +218,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and // Click 'Comandra blister rust (DSC)' checkbox cy.get('@clickShowHideBtn') - .click(); + .click({force: true}); cy.get('ul.parent-tree-table-toggle-menu') .find('li') @@ -234,7 +234,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and // Click 'Western gall rust (DSG)' checkbox cy.get('@clickShowHideBtn') - .click(); + .click({force: true}); cy.get('ul.parent-tree-table-toggle-menu') .find('li') @@ -250,7 +250,7 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and // Click 'Volume growth (GVO)' checkbox cy.get('@clickShowHideBtn') - .click(); + .click({force: true}); cy.get('ul.parent-tree-table-toggle-menu') .find('li') diff --git a/frontend/cypress/fixtures/aclass-reg-form.json b/frontend/cypress/fixtures/aclass-reg-form.json index ccdf93831..2faebe5d1 100644 --- a/frontend/cypress/fixtures/aclass-reg-form.json +++ b/frontend/cypress/fixtures/aclass-reg-form.json @@ -63,7 +63,7 @@ "title": "Cone and pollen count and SMP data", "subtitle": "Enter cone and pollen count (*required), SMP success on parent and SMP mix information ", "coneTitle": "Cone and pollen count", - "coneSubtitle": "Enter the estimative of Cone and pollen count for the orchard's seedlot (*required)", + "coneSubtitle": "Enter the cone and pollen count estimate for the orchard's seedlot (*required)", "smpSuccessTitle": "SMP success on parent", "smpSuccessSubtitle": "Enter the estimative of SMP success for the orchard's seedlot", "calculationSMPTitle": "Calculation of SMP mix", From ddab8d1f6f4a879fac911bf82cd16ea540c81de9 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Tue, 13 Aug 2024 12:06:25 -0700 Subject: [PATCH 25/33] fix: remove it.only --- .../e2e/smoke-test/a-class-seedlot-reg-form-ownership.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-ownership.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-ownership.cy.ts index c60913e81..b3799c490 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-ownership.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-ownership.cy.ts @@ -289,7 +289,7 @@ describe('A Class Seedlot Registration form, Ownership', () => { cy.saveSeedlotRegFormProgress(); }); - it.only('Funding source and method of payment default values and change the values', () => { + it('Funding source and method of payment default values and change the values', () => { // Expand the funding source combo box cy.get('#ownership-funding-source-0') .should('have.value', '') From 0507654bbd65c298fe2d490e245a376fbc28db0c Mon Sep 17 00:00:00 2001 From: Nisarg Date: Tue, 13 Aug 2024 12:08:36 -0700 Subject: [PATCH 26/33] feat: remove rows count --- frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts b/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts index 69ed88a02..378d7654a 100644 --- a/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts +++ b/frontend/cypress/e2e/smoke-test/my-seedlots.cy.ts @@ -263,13 +263,6 @@ describe('My seedlots page', () => { .find(`.${prefix}--pagination__items-count`) .should('include.text', '1–10'); - // Check total number of rows are 10 - cy.get(`table.${prefix}--data-table tbody`) - .find('tr') - .then(($row) => { - expect($row.length).equal(parseInt(dropdownNumber)); - }); - // Page number dropdown cy.get(`.${prefix}--pagination__right`) .find(`select.${prefix}--select-input`) From baa2b4a29cdb124cbe4278fffc57f9f92071fe91 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 22 Aug 2024 09:46:12 -0700 Subject: [PATCH 27/33] feat: add table to load --- .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 8c82ef1c5..0a2e28c35 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -106,6 +106,9 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); it('Cone and pollen count table entries', () => { + // Wait for the table to load + cy.get('#parentTreeNumber'); + // Check error message for negative Cone count cy.get('#212-coneCount-value-input') .type('-1') From 358e6585252a9a7300550d237b726c4a8f57bab8 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 22 Aug 2024 14:22:57 -0700 Subject: [PATCH 28/33] feat: add save seedlot progress --- .../a-class-seedlot-reg-form-collection-interim.cy.ts | 6 ++++++ .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-collection-interim.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-collection-interim.cy.ts index 84ead8f1b..94115ec0e 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-collection-interim.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-collection-interim.cy.ts @@ -480,6 +480,9 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', () .type('2024-05-25') .blur(); + // Save changes + cy.saveSeedlotRegFormProgress(); + cy.get('#end-date-input') .clear() .type('2024-05-26') @@ -509,6 +512,9 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', () .type('Test comment') .blur(); + // Save changes + cy.saveSeedlotRegFormProgress(); + // Press next button cy.get('.seedlot-registration-button-row') .find('button.form-action-btn') diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 0a2e28c35..ca9dc7617 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -1,4 +1,5 @@ import prefix from '../../../src/styles/classPrefix'; +import { THIRTY_SECONDS } from '../../constants'; describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and Pollen count)', () => { let regFormData: { @@ -106,7 +107,14 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); it('Cone and pollen count table entries', () => { + // Intercept the call + cy.intercept({ + method: 'GET', + url: '**/api/parent-trees/vegetation-codes/*' + }).as('parentTreesUnderVegCode'); + // Wait for the table to load + cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200); cy.get('#parentTreeNumber'); // Check error message for negative Cone count @@ -486,5 +494,8 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and .find(`.${prefix}--col`) .contains('Orchard parent tree geospatial summary') .should('be.visible'); + + // Save changes + cy.saveSeedlotRegFormProgress(); }); }); From a09607dd718ef9dc4f165b7135c55d6fc0dcd2f2 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 22 Aug 2024 15:19:41 -0700 Subject: [PATCH 29/33] feat: add table wait --- .../a-class-seedlot-reg-form-parent-tree-part-1.cy.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index ca9dc7617..1286adb9f 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -206,6 +206,16 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); it('Check \'Show/hide columns\' button functionality', () => { + // Intercept the call + cy.intercept({ + method: 'GET', + url: '**/api/parent-trees/vegetation-codes/*' + }).as('parentTreesUnderVegCode'); + + // Wait for the table to load + cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200); + cy.get('#parentTreeNumber'); + // Click 'Dothistroma needle blight (DFS)' checkbox cy.get(`.${prefix}--toolbar-content > span`) .eq(0) From 5eaf6a16e96b0e39eb9cb639d7140948a70a09bd Mon Sep 17 00:00:00 2001 From: Nisarg Date: Fri, 23 Aug 2024 10:28:24 -0700 Subject: [PATCH 30/33] feat: add table wait time ans save progress code --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts index 1286adb9f..c9a4dd4dc 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-parent-tree-part-1.cy.ts @@ -203,6 +203,9 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get('#212-coneCount-value-input') .clear() .blur(); + + // Save changes + cy.saveSeedlotRegFormProgress(); }); it('Check \'Show/hide columns\' button functionality', () => { @@ -284,9 +287,22 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get('thead.table-header') .find('#gvo') .should('exist'); + + // Save changes + cy.saveSeedlotRegFormProgress(); }); it('Check \'More Options\' button functionality', () => { + // Intercept the call + cy.intercept({ + method: 'GET', + url: '**/api/parent-trees/vegetation-codes/*' + }).as('parentTreesUnderVegCode'); + + // Wait for the table to load + cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200); + cy.get('#parentTreeNumber'); + // Check Download file option cy.get(`.${prefix}--toolbar-content > span`) .eq(1) @@ -424,9 +440,22 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and cy.get('#219-pollenCount-value-input') .should('have.value', '22'); + + // Save changes + cy.saveSeedlotRegFormProgress(); }); it('Pagination', () => { + // Intercept the call + cy.intercept({ + method: 'GET', + url: '**/api/parent-trees/vegetation-codes/*' + }).as('parentTreesUnderVegCode'); + + // Wait for the table to load + cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200); + cy.get('#parentTreeNumber'); + const dropdownNumber = '20'; // Number of item dropdown cy.get(`.${prefix}--pagination__left`) @@ -479,6 +508,16 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); it('Calculate Metrics button', () => { + // Intercept the call + cy.intercept({ + method: 'GET', + url: '**/api/parent-trees/vegetation-codes/*' + }).as('parentTreesUnderVegCode'); + + // Wait for the table to load + cy.wait('@parentTreesUnderVegCode', { timeout: THIRTY_SECONDS }).its('response.statusCode').should('equal', 200); + cy.get('#parentTreeNumber'); + // Check info sections not visible in DOM cy.get('.info-section-sub-title') .should('not.exist'); From 149b8215720e9febbbd1c1aa5a7c23c7865eeaea Mon Sep 17 00:00:00 2001 From: Craig Yu Date: Fri, 23 Aug 2024 11:55:33 -0700 Subject: [PATCH 31/33] fix: add select checks --- frontend/cypress/constants.ts | 2 +- .../e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/constants.ts b/frontend/cypress/constants.ts index 36940f5d8..82b4858dc 100644 --- a/frontend/cypress/constants.ts +++ b/frontend/cypress/constants.ts @@ -8,4 +8,4 @@ export const THIRTY_SECONDS = 3 * TEN_SECONDS; export const TYPE_DELAY = 50; export const INVALID_EMAIL = 'test.com.br'; -export const NUM_OF_LOOPS = 3; +export const NUM_OF_LOOPS = 1; // TODO back to 3 diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts index ec8e86c25..26ed43c02 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts @@ -496,6 +496,9 @@ describe('A Class Seedlot Registration form, Orchard', () => { .contains('F2 - Measured Cone Volume') .click(); + cy.get('#orchard-female-gametic') + .should('have.value', 'F2 - Measured Cone Volume'); + cy.get('#orchard-male-gametic') .siblings() .click(); @@ -505,6 +508,9 @@ describe('A Class Seedlot Registration form, Orchard', () => { .contains('M3 - Pollen Volume Estimate by 100% Survey') .click(); + cy.get('#orchard-male-gametic') + .should('have.value', 'M3 - Pollen Volume Estimate by 100% Survey'); + // Change radio inputs of gamete section cy.get('#controlled-cross-yes') .check({ force: true }); From e8ed3a642d185f180379592781778f86cb062ae3 Mon Sep 17 00:00:00 2001 From: Craig Yu Date: Fri, 23 Aug 2024 12:21:54 -0700 Subject: [PATCH 32/33] fix: wait for button to be enabled --- .../a-class-seedlot-reg-form-orchard.cy.ts | 24 ++++++++++++------- frontend/cypress/support/commands.ts | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts index 26ed43c02..33887e85c 100644 --- a/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts +++ b/frontend/cypress/e2e/smoke-test/a-class-seedlot-reg-form-orchard.cy.ts @@ -25,6 +25,8 @@ describe('A Class Seedlot Registration form, Orchard', () => { const parentTreeSet = new Set(); const unionParentTreeArray: string[] = []; const lengthOfArray = 6; + const F2GameticValue = 'F2 - Measured Cone Volume'; + const M3GameticValue = 'M3 - Pollen Volume Estimate by 100% Survey'; beforeEach(() => { // Login @@ -452,11 +454,11 @@ describe('A Class Seedlot Registration form, Orchard', () => { cy.get(`.${prefix}--list-box--expanded`) .find('ul li') - .contains('F2 - Measured Cone Volume') + .contains(F2GameticValue) .click(); cy.get('#orchard-female-gametic') - .should('have.value', 'F2 - Measured Cone Volume'); + .should('have.value', F2GameticValue); // Select male gametic contribution methodology cy.get('#orchard-male-gametic') @@ -465,11 +467,11 @@ describe('A Class Seedlot Registration form, Orchard', () => { cy.get(`.${prefix}--list-box--expanded`) .find('ul li') - .contains('M3 - Pollen Volume Estimate by 100% Survey') + .contains(M3GameticValue) .click(); cy.get('#orchard-male-gametic') - .should('have.value', 'M3 - Pollen Volume Estimate by 100% Survey'); + .should('have.value', M3GameticValue); // Check 'x' button cy.get('#orchard-female-gametic') @@ -493,11 +495,11 @@ describe('A Class Seedlot Registration form, Orchard', () => { cy.get(`.${prefix}--list-box--expanded`) .find('ul li') - .contains('F2 - Measured Cone Volume') + .contains(F2GameticValue) .click(); cy.get('#orchard-female-gametic') - .should('have.value', 'F2 - Measured Cone Volume'); + .should('have.value', F2GameticValue); cy.get('#orchard-male-gametic') .siblings() @@ -505,11 +507,11 @@ describe('A Class Seedlot Registration form, Orchard', () => { cy.get(`.${prefix}--list-box--expanded`) .find('ul li') - .contains('M3 - Pollen Volume Estimate by 100% Survey') + .contains(M3GameticValue) .click(); cy.get('#orchard-male-gametic') - .should('have.value', 'M3 - Pollen Volume Estimate by 100% Survey'); + .should('have.value', M3GameticValue); // Change radio inputs of gamete section cy.get('#controlled-cross-yes') @@ -603,6 +605,12 @@ describe('A Class Seedlot Registration form, Orchard', () => { // Save changes cy.saveSeedlotRegFormProgress(); + }); + + it('Step complete status', () => { + // Make sure value is loaded + cy.get('#orchard-breading-perc') + .should('have.value', '5'); // Press next button cy.get('.seedlot-registration-button-row') diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 2aa4038eb..1c0ab58da 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -103,6 +103,10 @@ Cypress.Commands.overwrite('log', (log, ...args) => { }); Cypress.Commands.add('saveSeedlotRegFormProgress', () => { + cy.get('.seedlot-registration-button-row') + .find('button.form-action-btn') + .should('not.be.disabled'); + cy.get('.seedlot-registration-button-row') .find('button.form-action-btn') .contains('Save changes') From e1f2d9d448d47eeca9bfcc6179a1baffdb6b87f3 Mon Sep 17 00:00:00 2001 From: Craig Yu Date: Fri, 23 Aug 2024 12:33:04 -0700 Subject: [PATCH 33/33] fix: loop back to 3 --- frontend/cypress/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/cypress/constants.ts b/frontend/cypress/constants.ts index 82b4858dc..36940f5d8 100644 --- a/frontend/cypress/constants.ts +++ b/frontend/cypress/constants.ts @@ -8,4 +8,4 @@ export const THIRTY_SECONDS = 3 * TEN_SECONDS; export const TYPE_DELAY = 50; export const INVALID_EMAIL = 'test.com.br'; -export const NUM_OF_LOOPS = 1; // TODO back to 3 +export const NUM_OF_LOOPS = 3;