Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance existing Cypress Test | Update existing facility | Facility Tab #6792

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading