feat: refs #8581 add validation command for card descriptor

This commit is contained in:
Jorge Penadés 2025-02-21 13:44:37 +01:00
parent 6d12fc2c1a
commit 9b0365aac4
1 changed files with 12 additions and 0 deletions

View File

@ -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]);
});