Skip to content

Commit

Permalink
Fix Flaky Cypress test in Facility Module (#6384)
Browse files Browse the repository at this point in the history
* fix random facility page failure

* fix random facility page failure
  • Loading branch information
nihal467 committed Oct 3, 2023
1 parent bebb693 commit e87de4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe("Location Management Section", () => {
cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
cy.get("[id='facility-details']").first().click();
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("h1.text-3xl.font-bold", { timeout: 10000 }).should("be.visible");
cy.get("#manage-facility-dropdown button").should("be.visible");
cy.get("[id='manage-facility-dropdown']").scrollIntoView().click();
cy.get("[id=location-management]").click();
Expand Down
3 changes: 1 addition & 2 deletions cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class FacilityPage {
}

clickManageFacilityDropdown() {
cy.get("h1.text-3xl.font-bold", { timeout: 20000 }).should("be.visible");
cy.get("#manage-facility-dropdown button").scrollIntoView();
cy.get("#manage-facility-dropdown button")
.contains("Manage Facility")
Expand Down Expand Up @@ -198,8 +199,6 @@ class FacilityPage {
cy.intercept("GET", "**/api/v1/facility/**").as("getManagePage");
cy.go("back");
cy.wait("@getManagePage").its("response.statusCode").should("eq", 200);
cy.get("#manage-facility-dropdown").scrollIntoView();
cy.get("#manage-facility-dropdown").should("exist");
}

verifyfacilityviewassetredirection() {
Expand Down

0 comments on commit e87de4f

Please sign in to comment.