Skip to content

Commit

Permalink
Enhance existing Cypress Test | Update existing facility | Facility T…
Browse files Browse the repository at this point in the history
…ab (#6792)

* facility update

* minor fix
  • Loading branch information
nihal467 authored Dec 5, 2023
1 parent 1e37ee4 commit 9504655
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe("Facility Creation", () => {
const totalDoctor = "10";
const facilityName = "cypress facility";
const facilityAddress = "cypress address";
const facilityUpdateAddress = "cypress updated address";
const facilityNumber = "9898469865";
const facilityErrorMessage = [
"Required",
Expand Down Expand Up @@ -210,17 +211,28 @@ describe("Facility Creation", () => {
});

it("Update the existing facility", () => {
// update a existing dummy data facility
facilityPage.visitUpdateFacilityPage(facilityUrl1);
facilityPage.clickManageFacilityDropdown();
facilityPage.clickUpdateFacilityOption();
facilityPage.clickUpdateFacilityType("Request Approving Center");
facilityPage.fillFacilityName("cypress facility updated");
facilityPage.fillAddress("Cypress Facility Updated Address");
facilityPage.fillOxygenCapacity("100");
facilityPage.fillExpectedOxygenRequirement("80");
facilityPage.clickUpdateFacilityType("Govt Hospital");
facilityPage.fillAddress(facilityUpdateAddress);
facilityPage.fillOxygenCapacity(oxygenCapacity);
facilityPage.fillExpectedOxygenRequirement(oxygenExpected);
facilityPage.selectLocation("Kochi, Kerala");
facilityPage.submitForm();
cy.url().should("not.include", "/update");
// verify the updated data
facilityPage.getFacilityOxygenInfo().scrollIntoView();
facilityPage
.getFacilityOxygenInfo()
.contains(oxygenCapacity)
.should("be.visible");
facilityPage.getAddressDetailsView().scrollIntoView();
facilityPage
.getAddressDetailsView()
.contains(facilityUpdateAddress)
.should("be.visible");
});

it("Configure the existing facility", () => {
Expand Down

0 comments on commit 9504655

Please sign in to comment.