feat: refs #8581 add custom Cypress commands for selecting descriptor options and validating checkboxes

This commit is contained in:
Jorge Penadés 2025-02-25 15:27:00 +01:00
parent 43e0134d41
commit 3993e37f39
1 changed files with 10 additions and 0 deletions

View File

@ -494,3 +494,13 @@ Cypress.Commands.add('checkDate', (rawDate, expectedVal, operation) => {
expect(date.isAfter(compareDate)).to.be.true;
}
});
Cypress.Commands.add('selectDescriptorOption', (opt = 1) => {
cy.get(
`[data-cy="descriptor-more-opts_list"] > :not(template):nth-of-type(${opt})`,
).click();
});
Cypress.Commands.add('validateCheckbox', (selector, expectedVal = 'true') => {
cy.get(selector).should('have.attr', 'aria-checked', expectedVal.toString());
});