From 24cd4caa964ef03b470d48822d27a50e0433d8a3 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 26 Feb 2025 17:31:47 +0100 Subject: [PATCH] fix: refs #8581 ensure actions descriptor is opened only when necessary in selectDescriptorOption command --- test/cypress/support/commands.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); });