From f02ded1773ff1b69605c77251ad5ff86de739c27 Mon Sep 17 00:00:00 2001 From: Krystof Stekovic Date: Mon, 14 Aug 2023 16:55:50 +0200 Subject: [PATCH] multille click on the reset form --- packages/testsuite/cypress/support/form-editing.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/testsuite/cypress/support/form-editing.ts b/packages/testsuite/cypress/support/form-editing.ts index 8d961a0b5..1dfe16430 100644 --- a/packages/testsuite/cypress/support/form-editing.ts +++ b/packages/testsuite/cypress/support/form-editing.ts @@ -19,7 +19,13 @@ Cypress.Commands.add("resetForm", (formId, managementApi, address) => { const resetButton = `#${formId} a.clickable[data-operation="reset"]`; // Setting the force parameter to true is a workaround turning off cypress checks whether the reset button is clickable, // as those checks sometimes fail. Next lines check the functionality (not) invoked by the button sufficiently. - cy.get(resetButton).click({ force: true }); + for (let reClickTry = 0; reClickTry < 5; reClickTry++) { + cy.get(resetButton).then(($button) => { + if ($button.is(":visible")) { + cy.get(resetButton).click(); + } + }); + } cy.get("body").then(($body) => { if ($body.find(".modal-footer .btn-hal.btn-primary").length) { cy.get(".modal-footer .btn-hal.btn-primary").click({ force: true });