From ddc81a387b120137423d6be661b08c9dc7d95202 Mon Sep 17 00:00:00 2001 From: Nisarg Date: Thu, 3 Oct 2024 12:30:45 -0700 Subject: [PATCH] feat: add orchard check --- ...-seedlot-reg-form-parent-tree-part-1.cy.ts | 61 +++++++++++++++++++ 1 file changed, 61 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 f2022f303..f3fd87780 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 @@ -34,6 +34,67 @@ describe('A Class Seedlot Registration form, Parent Tree and SMP part-1(Cone and }); }); + it('Check primary and secondary orchard values', () => { + // Press next button + cy.get('.seedlot-registration-button-row') + .find('button.form-action-btn') + .contains('Back') + .click(); + + // Check primary orchard + cy.get('#primary-orchard-selection') + .then($input => { + const value = $input.val(); + if (value === '') { + cy.log('Primary input is empty'); + // Do something if the input is empty + cy.get('#primary-orchard-selection') + .siblings(`button.${prefix}--list-box__menu-icon[title="Open"]`) + .click(); + + cy.get(`.${prefix}--list-box--expanded`) + .find('ul li') + .contains('219 - VERNON - S - PRD') + .click(); + + // Save changes + cy.saveSeedlotRegFormProgress(); + } + }); + + // Check secondary orchard + cy.get('#secondary-orchard-selection') + .then($input => { + const value = $input.val(); + if (value === '') { + cy.log('Secondary input is empty'); + // Do something if the input is empty + cy.get('#secondary-orchard-selection') + .siblings(`button.${prefix}--list-box__menu-icon[title="Open"]`) + .click(); + + cy.get(`.${prefix}--list-box--expanded`) + .find('ul li') + .contains('222 - VERNON - S - PRD') + .click(); + + // Save changes + cy.saveSeedlotRegFormProgress(); + } + }); + + // Press next button + cy.get('.seedlot-registration-button-row') + .find('button.form-action-btn') + .contains('Next') + .click(); + + cy.get('#parentTreeNumber').scrollIntoView(); + + // Save changes + cy.saveSeedlotRegFormProgress(); + }); + it('Page title and subtitles', () => { cy.get('.title-row') .find('h2')