Skip to content

Commit

Permalink
feat: add orchard check
Browse files Browse the repository at this point in the history
  • Loading branch information
ngunner15 committed Oct 3, 2024
1 parent 565729a commit ddc81a3
Showing 1 changed file with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ddc81a3

Please sign in to comment.