Skip to content

Commit

Permalink
multille click on the reset form
Browse files Browse the repository at this point in the history
  • Loading branch information
kstekovi committed Aug 14, 2023
1 parent caa0deb commit f02ded1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/testsuite/cypress/support/form-editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit f02ded1

Please sign in to comment.