diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 8f200c4ea..da98c2402 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -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(); });