From 3993e37f3940f2f353a42b510ace3c407fe1c3f0 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 25 Feb 2025 15:27:00 +0100 Subject: [PATCH] feat: refs #8581 add custom Cypress commands for selecting descriptor options and validating checkboxes --- test/cypress/support/commands.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 84dab231c..666dc5d76 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -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()); +});