From b6d5390754401e4e79f4d740b7fb8d79f7979cfd Mon Sep 17 00:00:00 2001 From: Vijetha-Kaja <119562824+Vijetha-Kaja@users.noreply.github.com> Date: Wed, 29 Mar 2023 22:10:42 +0530 Subject: [PATCH] test: Cypress - Flaky test fix (#21858) ## Description **Fixed below flaky tests** - GitImport_Spec.js - Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js - Form_With_CheckBox_spec.js ## Type of change - Flaky test fix ## How Has This Been Tested? - Cypress test runs ## Checklist: ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --- ...er_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js | 6 ++++-- .../ClientSideTests/Git/GitImport/GitImport_spec.js | 1 + .../ClientSideTests/Widgets/Form/Form_With_CheckBox_spec.js | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js index 95629303ab..1f0571b356 100644 --- a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js +++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js @@ -4,7 +4,8 @@ const formWidgetsPage = require("../../../../locators/FormWidgets.json"); const dsl = require("../../../../fixtures/formWithInputdsl.json"); const widgetsPage = require("../../../../locators/Widgets.json"); import { ObjectsRegistry } from "../../../../support/Objects/Registry"; -let ee = ObjectsRegistry.EntityExplorer; +let ee = ObjectsRegistry.EntityExplorer, + agHelper = ObjectsRegistry.AggregateHelper; before(() => { cy.addDsl(dsl); @@ -37,7 +38,8 @@ describe("Test Suite to validate copy/delete/undo functionalites", function () { "response.body.responseMeta.status", 200, ); - cy.get("body").type(`{${modifierKey}}z`); + agHelper.Sleep(1000); + cy.get("body").type(`{${modifierKey}}z`, { force: true }); ee.ExpandCollapseEntity("Widgets"); ee.ExpandCollapseEntity("FormTest"); ee.ActionContextMenuByEntityName("FormTestCopy", "Show Bindings"); diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js index 378b401fb3..2aefc546a2 100644 --- a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js +++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js @@ -200,6 +200,7 @@ describe("Git import flow ", function () { cy.wait(2000); // validate data binding in edit and deploy mode cy.latestDeployPreview(); + cy.get(".tbody").should("have.length", 2); cy.get(".tbody").first().should("contain.text", "Test user 7"); cy.xpath("//input[@value='this is a test']"); cy.xpath("//input[@value='Success']"); diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Form/Form_With_CheckBox_spec.js b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Form/Form_With_CheckBox_spec.js index 3f6ceb45af..4263f93f13 100644 --- a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Form/Form_With_CheckBox_spec.js +++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Form/Form_With_CheckBox_spec.js @@ -12,9 +12,9 @@ describe("Checkbox Widget Functionality", function () { cy.openPropertyPane("checkboxwidget"); cy.togglebar(commonlocators.requiredjs + " " + "input"); cy.PublishtheApp(); - cy.wait(1500); + cy.wait(2000); cy.get(publish.checkboxWidget).click(); - cy.get(publish.checkboxWidget).should("not.be.checked"); + cy.get('[type="checkbox"]').eq(0).should("not.be.checked"); cy.get(widgetsPage.formButtonWidget) .contains("Submit") .should("have.class", "bp3-disabled");