From 0ac5ce0956708afcba4d57a22be6bc7154c6a4d1 Mon Sep 17 00:00:00 2001 From: Nayden Naydenov <31909318+nnaydenow@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:20:08 +0200 Subject: [PATCH] chore: stabilize form support tests (#10296) The first step in most form tests is to check if the form can be submitted, which depends on the custom components having their validity set without interacting with them. This often causes tests to fail because Cypress tests sometimes run too quickly. --- packages/main/cypress/specs/FormSupport.cy.ts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/packages/main/cypress/specs/FormSupport.cy.ts b/packages/main/cypress/specs/FormSupport.cy.ts index cbd3c4664bbf..f3926064384b 100644 --- a/packages/main/cypress/specs/FormSupport.cy.ts +++ b/packages/main/cypress/specs/FormSupport.cy.ts @@ -41,6 +41,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -78,6 +81,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -107,6 +113,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -148,6 +157,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -189,6 +201,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -230,6 +245,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -271,6 +289,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -335,6 +356,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -396,6 +420,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -433,6 +460,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -471,6 +501,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -498,6 +531,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -513,6 +549,7 @@ describe("Form support", () => { cy.get("#rb_4") .realClick(); + // eslint-disable-next-line cypress/no-unnecessary-waiting // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(200); @@ -538,6 +575,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -610,6 +650,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -655,6 +698,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -683,6 +729,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -712,6 +761,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -750,6 +802,9 @@ describe("Form support", () => { `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -792,6 +847,9 @@ describe("Form support", () => { `); /* eslint-enable no-irregular-whitespace */ + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -828,6 +886,9 @@ describe("Form support", () => { Does not submit forms `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault()); @@ -872,6 +933,9 @@ describe("Form support", () => { Submits forms `); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200); + cy.get("form") .then($item => { $item.get(0).addEventListener("submit", e => e.preventDefault());