From 70f5ea7f8c273c4b141611166af192bec83c4ebf Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:07:18 +0530 Subject: [PATCH] implement wait until --- cypress/e2e/facility_spec/FacilityHomepage.cy.ts | 2 ++ cypress/pageobject/Facility/FacilityHome.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts index 6b4cbfc3782..fec26e49b0d 100644 --- a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts +++ b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts @@ -108,11 +108,13 @@ describe("Facility Homepage Function", () => { facilityHome.csvDownloadIntercept(doctorsAlias, "&doctors"); facilityHome.clickExportButton(); facilityHome.clickMenuItem("Doctors"); + facilityHome.verifyDownload(doctorsAlias); facilityHome.clickSearchButton(); // Download the Triages CSV facilityHome.csvDownloadIntercept(triagesAlias, "&triage"); facilityHome.clickExportButton(); facilityHome.clickMenuItem("Triages"); + facilityHome.verifyDownload(triagesAlias); facilityHome.clickSearchButton(); }); diff --git a/cypress/pageobject/Facility/FacilityHome.ts b/cypress/pageobject/Facility/FacilityHome.ts index ba8ffb77c32..956c374ada4 100644 --- a/cypress/pageobject/Facility/FacilityHome.ts +++ b/cypress/pageobject/Facility/FacilityHome.ts @@ -90,8 +90,9 @@ class FacilityHome { } verifyDownload(alias: string) { - cy.wait(`@${alias}`).its("response.statusCode").should("eq", 200); - cy.wait(5000); + cy.wait(`@${alias}`, { timeout: 60000 }) + .its("response.statusCode") + .should("eq", 200); } getURL() {