From 9b0365aac4eec2279e7ec531aefd43cf703cee3e Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 21 Feb 2025 13:44:37 +0100 Subject: [PATCH] feat: refs #8581 add validation command for card descriptor --- test/cypress/support/commands.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 791fd46ec..375737395 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -418,6 +418,7 @@ Cypress.Commands.add('clickButtonWith', (type, value) => { break; } }); + Cypress.Commands.add('clickButtonWithIcon', (iconClass) => { cy.get(`.q-icon.${iconClass}`).parent().click(); }); @@ -425,3 +426,14 @@ Cypress.Commands.add('clickButtonWithIcon', (iconClass) => { Cypress.Commands.add('clickButtonWithText', (buttonText) => { cy.get('.q-btn').contains(buttonText).click(); }); + +Cypress.Commands.add('validateDescriptor', (toCheck = {}) => { + const { title, listbox } = toCheck; + + if (title) cy.dataCy('cardDescriptor_title').contains(title); + + for (const index in listbox) + cy.get('[data-cy="cardDescriptor_listbox"] > *') + .eq(index) + .should('contain.text', listbox[index]); +});