Skip to content

Commit

Permalink
modified delete facility test
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Feb 26, 2024
1 parent 28e40e0 commit f5ad646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions cypress/e2e/facility_spec/facility_creation.cy.ts
Expand Up @@ -136,25 +136,30 @@ describe("Facility Creation", () => {
facilityPage.fillExpectedDTypeCylinderRequirement(oxygenExpected);
facilityPage.selectLocation("Kochi, Kerala");
facilityPage.submitForm();
cy.closeNotification();
// create multiple bed capacity and verify card reflection
facilityPage.selectBedType("Oxygen beds");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
cy.closeNotification();
facilityPage.selectBedType("Ordinary Bed");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
cy.closeNotification();
facilityPage.getTotalBedCapacity().contains(totalCapacity);
facilityPage.getTotalBedCapacity().contains(totalOccupancy);
facilityPage.clickcancelbutton();
// create multiple bed capacity and verify card reflection
facilityPage.selectAreaOfSpecialization("General Medicine");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.clickdoctorcapacityaddmore();
cy.closeNotification();
facilityPage.selectAreaOfSpecialization("Pulmonology");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.clickdoctorcapacityaddmore();
cy.closeNotification();
facilityPage.getTotalDoctorCapacity().contains(doctorCapacity);
facilityPage.clickcancelbutton();
facilityPage.verifyfacilitynewurl();
Expand Down
4 changes: 1 addition & 3 deletions cypress/pageobject/Facility/FacilityCreation.ts
Expand Up @@ -289,9 +289,7 @@ class FacilityPage {
}

confirmDeleteFacility() {
cy.intercept("DELETE", "**/api/v1/facility/**").as("deleteFacility");
cy.get("#submit").contains("Delete").click();
cy.wait("@deleteFacility").its("response.statusCode").should("eq", 403);
cy.submitButton("Delete");
}

selectLocation(location: string) {
Expand Down

0 comments on commit f5ad646

Please sign in to comment.