fix: refs #8581 ensure actions descriptor is opened only when necessary in selectDescriptorOption command

This commit is contained in:
Jorge Penadés 2025-02-26 17:31:47 +01:00
parent 6271dea2c7
commit 24cd4caa96
1 changed files with 4 additions and 1 deletions

View File

@ -501,8 +501,11 @@ Cypress.Commands.add('checkDate', (rawDate, expectedVal, operation) => {
});
Cypress.Commands.add('selectDescriptorOption', (opt = 1) => {
cy.openActionsDescriptor();
const listItem = '[data-cy="descriptor-more-opts_list"]';
cy.get('body').then(($body) => {
if (!$body.find(listItem).length) cy.openActionsDescriptor();
});
cy.waitForElement(listItem);
cy.get(`${listItem} > :not(template):nth-of-type(${opt})`).click();
});