Skip to content

Commit

Permalink
flaky test in resource tab test
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Dec 15, 2024
1 parent 4f05216 commit cfb743a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions cypress/e2e/resource_spec/ResourcesHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ describe("Resource Page", () => {
beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/resource");
});

it("Checks if all download button works", () => {
resourcePage.navigationToResourcePage();
resourcePage.verifyDownloadButtonWorks();
});

it("Switch between active/completed", () => {
resourcePage.navigationToResourcePage();
resourcePage.spyResourceApi();
resourcePage.clickCompletedResources();
resourcePage.verifyCompletedResources();
Expand All @@ -37,6 +38,7 @@ describe("Resource Page", () => {
});

it("Switch between list view and board view", () => {
resourcePage.navigationToResourcePage();
resourcePage.clickListViewButton();
resourcePage.clickBoardViewButton();
});
Expand Down Expand Up @@ -68,7 +70,7 @@ describe("Resource Page", () => {
});

it("Update the status of resource", () => {
cy.visit(createdResource);
cy.awaitUrl(createdResource);
resourcePage.clickUpdateStatus();
resourcePage.updateStatus("APPROVED");
resourcePage.clickSubmitButton();
Expand All @@ -78,7 +80,7 @@ describe("Resource Page", () => {
});

it("Post comment for a resource", () => {
cy.visit(createdResource);
cy.awaitUrl(createdResource);
resourcePage.addCommentForResource("Test comment");
resourcePage.clickPostCommentButton();
resourcePage.verifySuccessNotification("Comment added successfully");
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Facility/FacilityHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FacilityHome {
}

navigateToFacilityHomepage() {
cy.visit("/facility");
cy.awaitUrl("/facility");
}

assertFacilityInCard(facilityName: string) {
Expand Down
4 changes: 4 additions & 0 deletions cypress/pageobject/Resource/ResourcePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class ResourcePage {
cy.contains("button", "Active").click();
}

navigationToResourcePage() {
cy.awaitUrl("/resource");
}

verifyActiveResources() {
cy.wait("@resource").its("response.statusCode").should("eq", 200);
cy.contains("button", "Active").should("have.class", "text-white");
Expand Down

0 comments on commit cfb743a

Please sign in to comment.