From d52f60666aaea750ca3bc2cb19e169f4a5c19a44 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 11 Mar 2025 08:50:54 +0100 Subject: [PATCH] feat: refs #8602 add custom Cypress commands for improved element interaction and request handling --- test/cypress/support/commands.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 0e366053c..1dfd5a0f1 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -402,3 +402,18 @@ Cypress.Commands.add('clickButtonWithIcon', (iconClass) => { Cypress.Commands.add('clickButtonWithText', (buttonText) => { cy.get('.q-btn').contains(buttonText).click(); }); + +Cypress.Commands.add('getOption', (index = 1) => { + cy.waitForElement('[role="listbox"]'); + cy.get(`[role="listbox"] .q-item:nth-child(${index})`).click(); +}); + +Cypress.Commands.add('searchBtnFilterPanel', () => { + cy.get( + '.q-scrollarea__content > .q-btn--standard > .q-btn__content > .q-icon', + ).click(); +}); + +Cypress.Commands.add('waitRequest', (alias, cb) => { + cy.wait(alias).then(cb); +});