Skip to content

Commit

Permalink
Merge branch 'develop' into issue/9315/facilitycard-tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Dec 18, 2024
2 parents 6d34778 + 3979b53 commit 367c512
Show file tree
Hide file tree
Showing 34 changed files with 375 additions and 187 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ rolesToTest.forEach((role) => {
it("Export the list of assets in CSV & Json", () => {
if (role === "districtAdmin") {
assetHome.selectAssetImportButton("click");
cy.wait(2000);
assetHome.selectJsonExportButton();
assetHome.selectAssetImportButton("click");
assetHome.selectCsvExportButton();
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe("Facility Creation with multiple user roles", () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.restoreLocalStorage();
cy.awaitUrl("/facility");
});

it("Create a new facility with all fields | Edit Existing Data | Verify its reflection", () => {
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ describe("Facility Homepage Function", () => {
});

it("Verify the bed capacity badge reflection", () => {
facilityHome.interceptFacilitySearchReq();
facilityHome.typeFacilitySearch(facilityWithNoAvailableBeds);
facilityHome.verifyFacilitySearchReq();
facilityHome.assertFacilityInCard(facilityWithNoAvailableBeds);
cy.url().then((url) => {
const facilityUrl = url.toString();
Expand Down
13 changes: 9 additions & 4 deletions cypress/e2e/facility_spec/FacilityInventory.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ describe("Inventory Management Section", () => {

it("Add New Inventory | Modify data and delete last entry ", () => {
// add a new item
facilityPage.interceptManageInventoryItem();
facilityPage.clickManageInventory();
facilityPage.verifyManageInventoryItem();
facilityPage.fillInventoryDetails("PPE", "Add Stock", "10");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
cy.closeNotification();
facilityPage.clickManageInventory();
// modify the new item
facilityPage.fillInventoryDetails("PPE", "Use Stock", "5");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
facilityPage.verifySuccessNotification(
"Inventory use stock updated successfully",
);
// verify the new modification
facilityPage.verifyPpeQuantity("PPE");
facilityPage.verifyPpeQuantity("5");
Expand All @@ -43,7 +48,6 @@ describe("Inventory Management Section", () => {
// verify the last entry deletion
facilityPage.verifyStockInRow("#row-0", "Added Stock");
facilityPage.verifyStockInRow("#row-1", "Used Stock");
cy.wait(3000);
facilityHome.navigateBack();
facilityPage.verifyPpeQuantity("PPE");
});
Expand All @@ -57,9 +61,10 @@ describe("Inventory Management Section", () => {
cy.closeNotification();
// Verify Backend minimum badge
facilityPage.verifyBadgeWithText(".badge-danger", "Low Stock");
facilityPage.interceptMinimumQuantity();
// modify with manual minimum badge
facilityPage.clickAddMinimumQuanitity();
cy.wait(3000);
facilityPage.clickAddMinimumQuantity();
facilityPage.verifyMinimumQuantity();
cy.get("body").then(($body) => {
if ($body.find("#update-minimum-quantity").is(":visible")) {
// If the 'update-minimum-quantity' element is visible, click it
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ describe("Patient Consultation in multiple combination", () => {
patientPrescription.selectMedicine(medicineOne);
patientPrescription.enterDosage("3");
patientPrescription.selectDosageFrequency("Twice daily");
patientPrescription.interceptPrescriptions();
cy.clickSubmitButton("Submit");
cy.wait(2000);
patientPrescription.verifyPrescription();
cy.verifyNotification("Medicine prescribed");
patientPrescription.clickReturnToDashboard();
// Verify the data's across the dashboard
Expand Down Expand Up @@ -376,7 +377,9 @@ describe("Patient Consultation in multiple combination", () => {

it("Edit created consultation to existing patient", () => {
patientPage.visitPatient("Dummy Patient Thirteen");
patientConsultationPage.interceptConsultation();
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.verifyConsultation();
patientConsultationPage.typePatientIllnessHistory("editted");
patientConsultationPage.selectPatientDiagnosis(
diagnosis5,
Expand Down
12 changes: 8 additions & 4 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason4);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -53,7 +55,9 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.typeDischargeNote(patientDeathCause);
patientDischarge.typeDoctorName(doctorName);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -76,10 +80,10 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.clickClearButton();
// select a non-registered facility and perform the discharge
patientDischarge.typeReferringFacility(referringFreetextFacility);
cy.wait(2000);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -106,12 +110,12 @@ describe("Patient Discharge based on multiple reason", () => {
patientPrescription.selectDosageFrequency("Twice daily");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.wait(2000);
cy.closeNotification();
// submit the discharge pop-up
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ describe("Patient Homepage present functionalities", () => {
.then((patientOne: string) => {
firstPatientPageOne = patientOne.trim();
pageNavigation.navigateToNextPage();
cy.wait(2000);
pageNavigation.verifyCurrentPageNumber(2);
cy.get('[data-cy="patient"]')
.first()
Expand Down
19 changes: 17 additions & 2 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
Expand All @@ -80,11 +82,15 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientOne);
patientLogupdate.interceptConsultationBed();
patientLogupdate.clickLogupdate();
patientLogupdate.verifyConsultationBed();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedOne);
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
// Only will be using random non-unique progress note fields
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectPatientCategory(patientCategory);
Expand Down Expand Up @@ -112,15 +118,18 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
patientLogupdate.interceptDailyRounds();
cy.clickSubmitButton("Save and Continue");
cy.wait(2000);
patientLogupdate.verifyDailyRounds();
cy.verifyNotification("Progress Note created successfully");
cy.closeNotification();
// modify the relevant critical care log update
patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.get("#left_pupil_light_reaction-option-FIXED").click();
patientLogupdate.interceptpatchDailyRounds();
cy.clickSubmitButton("Update Details");
patientLogupdate.verifypatchDailyRounds();
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
Expand Down Expand Up @@ -156,7 +165,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.selectRoundType("Detailed Update");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.interceptDailyRounds();
cy.clickSubmitButton("Save and Continue");
patientLogupdate.verifyDailyRounds();
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
Expand Down Expand Up @@ -235,7 +246,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedThree);
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
Expand All @@ -251,9 +264,11 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
patientConsultationPage.interceptConsultation();
cy.clickSubmitButton("Save");
cy.wait(2000);
patientConsultationPage.verifyConsultation();
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/patient_spec/PatientPrescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe("Patient Medicine Administration", () => {
cy.closeNotification();
// Administer the medicine in edit form
patientPrescription.clickAdministerButton();
cy.wait(2000);
patientPrescription.enterAdministerDosage(medicineBaseDosage);
patientPrescription.enterAdministerNotes(medicineAdministerNote);
cy.clickSubmitButton("Administer Medicine");
Expand Down
8 changes: 3 additions & 5 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ describe("Patient Creation with consultation", () => {
patientPage.createPatientWithData(newPatientData);
// Verify the patient details
patientPage.clickCancelButton();
cy.wait(3000);
patientPage.savePatientUrl();
patientPage.verifyPatientDashboardDetails(
patientOneGender,
Expand Down Expand Up @@ -197,11 +196,11 @@ describe("Patient Creation with consultation", () => {
patientOneSecondInsurerName,
);
patientPage.clickUpdatePatient();
cy.wait(3000);
patientPage.verifyPatientUpdated();
patientPage.interceptGetPatient();
patientPage.visitPatientUrl();
patientPage.verifyGetPatientResponse();
// Verify Female Gender change reflection, No Medical History and Insurance Details
cy.wait(5000);
patientPage.verifyPatientDashboardDetails(
patientOneUpdatedGender,
age,
Expand All @@ -218,7 +217,6 @@ describe("Patient Creation with consultation", () => {
cy.get("[data-testid=patient-details]")
.contains("Member ID")
.scrollIntoView();
cy.wait(2000);
patientInsurance.verifyPatientPolicyDetails(
patientOneFirstSubscriberId,
patientOneFirstPolicyId,
Expand Down Expand Up @@ -249,7 +247,7 @@ describe("Patient Creation with consultation", () => {
// allow the transfer button of a patient
patientTransfer.clickAllowPatientTransferButton();
// Verify the patient error message for the same facility
cy.awaitUrl("/patients");
cy.visit("/patients");
patientPage.createPatient();
patientPage.selectFacility(patientTransferFacility);
patientPage.patientformvisibility();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ describe("User Creation", () => {
userProfilePage.clearWorkingHours();
userProfilePage.typeWorkingHours(weeklyWorkingHrs);
userProfilePage.typeDateOfBirth(dob);
cy.intercept("PATCH", "/api/v1/users/*").as("updateUser");
userProfilePage.interceptUpdateUsers();
userProfilePage.clickUpdateButton();
cy.wait("@updateUser").its("response.statusCode").should("eq", 200);
userProfilePage.verifyUpdateUsersResponse();
cy.verifyContentPresence("#contactno-profile-details", [
"+91" + phoneNumber,
]);
Expand Down Expand Up @@ -158,9 +158,9 @@ describe("User Creation", () => {
userCreationPage.selectGender(gender);
userCreationPage.selectState(state);
userCreationPage.selectDistrict(district);
cy.intercept("POST", "/api/v1/users/add_user/").as("createUser");
userCreationPage.interceptCreateUser();
userCreationPage.clickSaveUserButton();
cy.wait("@createUser").its("response.statusCode").should("eq", 201);
userCreationPage.verifyCreateUser();
cy.verifyNotification("User added successfully");
userPage.typeInSearchInput(username);
userPage.checkUsernameText(username);
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,15 @@ describe("Manage User", () => {
userPage.checkUsernameText(usernameforworkinghour);
manageUserPage.clickMoreDetailsButton(usernameforworkinghour);
manageUserPage.verifyMoreDetailsPage();
manageUserPage.interceptLinkedSkillTab();
manageUserPage.clickLinkedSkillTab();
cy.wait(500);
manageUserPage.verifyLinkedSkillResponse();
manageUserPage.verifyLinkedSkillsTabPage();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.interceptAddSkill();
manageUserPage.clickAddSkillButton(usernameforworkinghour);
cy.wait(500);
manageUserPage.verifyAddSkillResponse();
manageUserPage.assertSkillInAddedUserSkills(linkedskill);
cy.wait(500);
manageUserPage.navigateToProfile();
cy.verifyContentPresence("#username-profile-details", [
usernameforworkinghour,
Expand Down
6 changes: 3 additions & 3 deletions cypress/pageobject/Asset/AssetHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ export class AssetHome {
selectAssetImportButton(action: "click" | "verifyNotExist"): void {
const selector = "[data-testid=import-asset-button]";
if (action === "click") {
cy.get(selector).click();
cy.get(selector).scrollIntoView().should("be.visible").click();
} else if (action === "verifyNotExist") {
cy.get(selector).should("not.exist");
}
}

selectJsonExportButton() {
cy.intercept("GET", "**/api/v1/asset/?**json=true**").as("getJsonexport");
cy.get("#export-json-option").click();
cy.get("#export-json-option").should("be.visible").click();
cy.wait("@getJsonexport").its("response.statusCode").should("eq", 200);
}

selectCsvExportButton() {
cy.intercept("GET", "**/api/v1/asset/?**csv=true**").as("getCsvexport");
cy.get("#export-csv-option").click();
cy.get("#export-csv-option").should("be.visible").click();
cy.wait("@getCsvexport").its("response.statusCode").should("eq", 200);
}

Expand Down
Loading

0 comments on commit 367c512

Please sign in to comment.