test: Cypress - Flaky fix (#22247)

## Description

- This PR fixes below flaky test in CI:
- Button_onClickAction_spec.js

## Type of change

- Script fix (non-breaking change which fixes CI failure issue)


## How Has This Been Tested?

- Cypress local run

## Checklist:

### QA activity:
- [X] Added Test Plan Approved label after reviewing all changes
This commit is contained in:
Aishwarya-U-R 2023-04-11 00:36:26 +05:30 committed by GitHub
parent afc278fd9b
commit 217c40b20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,13 +18,9 @@ describe("Button Widget Functionality", function () {
//creating the Modal and verify Modal name
cy.createModal(this.data.ModalName, "onClick");
cy.PublishtheApp();
cy.wait(3000); //for page to load fully
cy.get(publishPage.buttonWidget).should("be.visible");
cy.get(publishPage.buttonWidget).click();
cy.get("body").then(($ele) => {
if ($ele.find(modalWidgetPage.modelTextField).length <= 0) {
cy.get(publishPage.buttonWidget).click({ force: true });
}
});
cy.get(modalWidgetPage.modelTextField).should(
"have.text",
this.data.ModalName,