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

Add Cypress Test Suite for Sample Test Request Workflow #8977

Merged
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1511f69
Add Sample Test Request creation
JavidSumra Oct 29, 2024
8f5448d
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/8…
JavidSumra Oct 30, 2024
36b1ceb
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/8…
JavidSumra Nov 1, 2024
66bfe4a
Add TestSuit to request for sample test
JavidSumra Nov 1, 2024
c37f252
Undo the changes in .env file
JavidSumra Nov 1, 2024
3b731aa
fix request sample test for button id if exist
JavidSumra Nov 1, 2024
b9edb9b
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 4, 2024
a03ce0d
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/8…
JavidSumra Nov 5, 2024
c6e12eb
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 5, 2024
e1ffd14
requested changes update
JavidSumra Nov 5, 2024
e89ec71
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/8…
JavidSumra Nov 5, 2024
a882727
Merge branch 'ohcnetwork:develop' into issues/8926/add-sample-test
JavidSumra Nov 5, 2024
988fbb1
Merge branch 'issues/8926/add-sample-test' of github.com:JavidSumra/c…
JavidSumra Nov 5, 2024
f7e9ef3
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/8…
JavidSumra Nov 7, 2024
7f8a699
Add Requested Changes
JavidSumra Nov 7, 2024
641137a
Removing Unnecessary Spaces
JavidSumra Nov 7, 2024
a283e5b
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 8, 2024
71f893e
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 8, 2024
b4bb3f5
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 9, 2024
ac4ee22
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/8…
JavidSumra Nov 9, 2024
95de134
Add Requested Changes
JavidSumra Nov 9, 2024
62e4f5d
Merge branch 'issues/8926/add-sample-test' of github.com:JavidSumra/c…
JavidSumra Nov 9, 2024
52f794a
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 10, 2024
a2627cc
fix merge conflicts
JavidSumra Nov 10, 2024
81a1ae8
fix merge conflicts
JavidSumra Nov 10, 2024
b184a12
Merge branch 'develop' into issues/8926/add-sample-test
JavidSumra Nov 11, 2024
4135708
Merge branch 'develop' into pr/8977
nihal467 Nov 18, 2024
ac10909
fixed flaky test in HCX and user
nihal467 Nov 18, 2024
8d4bd40
verifying the content presence
nihal467 Nov 18, 2024
8a73752
refactor the work flow
nihal467 Nov 18, 2024
1b8b464
add additional check for facility
nihal467 Nov 18, 2024
9b8a8f8
rearranged the verification
nihal467 Nov 18, 2024
6369c15
Merge branch 'develop' into issues/8926/add-sample-test
nihal467 Nov 18, 2024
a38fab3
modified the api
nihal467 Nov 18, 2024
1ec01aa
Merge branch 'issues/8926/add-sample-test' of https://github.com/Javi…
nihal467 Nov 18, 2024
b220acd
modified the api
nihal467 Nov 18, 2024
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
4 changes: 2 additions & 2 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ describe("Facility Homepage Function", () => {
facilityNotify.verifyFacilityName(facilityName);
facilityNotify.fillNotifyText(notificationMessage);
facilityNotify.interceptPostNotificationReq();
cy.submitButton("Notify");
cy.clickSubmitButton("Notify");
facilityNotify.verifyPostNotificationReq();
cy.verifyNotification("Facility Notified");
cy.closeNotification();
cy.wait(2000);
// Verify the frontend error on empty message
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
cy.submitButton("Notify");
cy.clickSubmitButton("Notify");
facilityNotify.verifyErrorMessage(notificationErrorMsg);
// close pop-up and verify
facilityHome.verifyAndCloseNotifyModal();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/facility_spec/FacilityLocation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ describe("Location Management Section", () => {
facilityLocation.clickAddNewLocationButton();
facilityLocation.enterLocationName("Test Location with Beds");
facilityLocation.selectLocationType("OTHER");
cy.submitButton("Add Location");
cy.clickSubmitButton("Add Location");
cy.verifyNotification("Location created successfully");
cy.closeNotification();
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
facilityLocation.enterBedName("Bed 1");
facilityLocation.selectBedType("Regular");
cy.submitButton("Add Bed(s)");
cy.clickSubmitButton("Add Bed(s)");
cy.verifyNotification("1 Bed created successfully");
cy.closeNotification();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
Expand Down
4 changes: 3 additions & 1 deletion cypress/e2e/hcx_spec/HcxClaims.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("HCX Claims configuration and approval workflow", () => {
firstInsuranceIdentifier,
patientInsurerName,
);
cy.submitButton("Save Details");
cy.clickSubmitButton("Save Details");
cy.verifyNotification("Patient updated successfully");
cy.closeNotification();
// Navigate to Consultation View and capture dynamic consultation ID
Expand Down Expand Up @@ -80,6 +80,8 @@ describe("HCX Claims configuration and approval workflow", () => {
// Raise a HCX Pre-auth
patientConsultationPage.clickManagePatientButton();
patientConsultationPage.clickClaimsButton();
cy.verifyAndClickElement("#edit-insurance-policy", "Edit Insurance Policy");
cy.clickCancelButton();
hcxClaims.selectEligiblePolicy(patientInsurerName);
hcxClaims.verifyPolicyEligibility();
cy.verifyNotification("Checking Policy Eligibility");
Expand Down
22 changes: 11 additions & 11 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.typeSpecialInstruction(specialInstruction);
patientTreatmentPlan.fillTreatingPhysican(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
// the above submit should fail as IP number is missing
patientConsultationPage.typePatientNumber(patientIpNumber);
patientConsultationPage.selectBed("Dummy Bed 6");
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// Below code for the prescription module only present while creating a new consultation
patientPrescription.clickAddPrescription();
Expand All @@ -104,7 +104,7 @@ describe("Patient Consultation in multiple combination", () => {
patientPrescription.selectMedicine(medicineOne);
patientPrescription.enterDosage("3");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.wait(2000);
Comment on lines +107 to 108
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace hard-coded wait with proper assertion

Using cy.wait(2000) is an anti-pattern in Cypress. Instead, wait for the API response or UI state change.

 cy.clickSubmitButton("Submit");
-cy.wait(2000);
+cy.intercept('POST', '**/prescriptions').as('prescriptionSubmit');
+cy.wait('@prescriptionSubmit');
 cy.verifyNotification("Medicine prescribed");

Committable suggestion skipped: line range outside the PR's diff.

cy.verifyNotification("Medicine prescribed");
patientPrescription.clickReturnToDashboard();
Expand Down Expand Up @@ -189,7 +189,7 @@ describe("Patient Consultation in multiple combination", () => {
"#encounter_date",
"220220241230",
);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification(
"Create Diagnoses - Atleast one diagnosis is required",
);
Expand All @@ -198,7 +198,7 @@ describe("Patient Consultation in multiple combination", () => {
diagnosis4,
"add-icd11-diagnosis-as-confirmed",
);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// verify the data and death report
patientConsultationPage.verifyTextInConsultation(
Expand All @@ -215,7 +215,7 @@ describe("Patient Consultation in multiple combination", () => {
"#cause_of_death",
"Cause of Death",
);
cy.submitButton("Preview");
cy.clickSubmitButton("Preview");
cy.preventPrint();
patientDeathReport.clickPrintDeathReport();
cy.get("@verifyPrevent").should("be.called");
Expand Down Expand Up @@ -261,7 +261,7 @@ describe("Patient Consultation in multiple combination", () => {
// add telemedicine
patientTreatmentPlan.clickTelemedicineCheckbox();
patientTreatmentPlan.assignTelemedicineDoctor(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// verify the data reflection -
patientConsultationPage.verifyTextInConsultation(
Expand Down Expand Up @@ -312,7 +312,7 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
// no review after and no action
patientTreatmentPlan.fillTreatingPhysican(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Patient discharged successfully");
// verify the Discharge Reason, Diagnosis, treatment physican
patientConsultationPage.verifyTextInConsultation(
Expand Down Expand Up @@ -364,13 +364,13 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.fillTreatingPhysican(doctorName);
// no review after and no action
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
// Create a shifting request
cy.closeNotification();
shiftCreation.typeCurrentFacilityPerson("Current Facility Person");
shiftCreation.typeCurrentFacilityPhone("9999999999");
shiftCreation.typeShiftReason("reason for shift");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Shift request created successfully");
});

Expand All @@ -386,7 +386,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.get("#condition-verification-status-menu").click();
cy.get("#add-icd11-diagnosis-as-entered-in-error").click();
});
cy.submitButton("Update Consultation");
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.get("#diagnoses-view").should("not.contain.text", diagnosis5);
Comment on lines +389 to 391
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add API intercept for consultation update

Add an intercept for the update API call to ensure the request completes before verifying the UI changes.

+cy.intercept('PUT', '**/consultation/*').as('updateConsultation');
 cy.clickSubmitButton("Update Consultation");
+cy.wait('@updateConsultation');
 cy.verifyNotification("Consultation updated successfully");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.get("#diagnoses-view").should("not.contain.text", diagnosis5);
cy.intercept('PUT', '**/consultation/*').as('updateConsultation');
cy.clickSubmitButton("Update Consultation");
cy.wait('@updateConsultation');
cy.verifyNotification("Consultation updated successfully");
cy.get("#diagnoses-view").should("not.contain.text", diagnosis5);

patientConsultationPage.verifyTextInConsultation(
Expand Down
18 changes: 9 additions & 9 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe("Patient Discharge based on multiple reason", () => {
patientPage.visitPatient("Dummy Patient 12");
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason4);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
Comment on lines +37 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add assertions between consecutive button clicks

Multiple consecutive button clicks without intermediate assertions or waits could lead to flaky tests if the UI hasn't finished processing the first action.

Consider adding appropriate assertions or waits:

 cy.clickSubmitButton("Confirm Discharge");
+cy.get('.discharge-confirmation-dialog').should('be.visible');
 cy.clickSubmitButton("Acknowledge & Submit");

Committable suggestion skipped: line range outside the PR's diff.

cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -52,8 +52,8 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.selectDischargeReason(patientDischargeReason3);
patientDischarge.typeDischargeNote(patientDeathCause);
patientDischarge.typeDoctorName(doctorName);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -77,8 +77,8 @@ describe("Patient Discharge based on multiple reason", () => {
// select a non-registered facility and perform the discharge
patientDischarge.typeReferringFacility(referringFreetextFacility);
cy.wait(2000);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
Comment on lines +80 to 83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace arbitrary waits with proper assertions

Using fixed timeouts (cy.wait(2000)) is an anti-pattern in Cypress and can make tests flaky. Instead, use explicit assertions to wait for specific conditions.

Consider replacing the waits with assertions:

-cy.wait(2000);
 cy.clickSubmitButton("Confirm Discharge");
+cy.get('.discharge-confirmation-dialog').should('be.visible');
 cy.clickSubmitButton("Acknowledge & Submit");
-cy.wait(2000);
+cy.get('.notification-toast').should('be.visible');
 cy.verifyNotification("Patient Discharged Successfully");

Committable suggestion skipped: line range outside the PR's diff.

cy.closeNotification();
Expand All @@ -104,13 +104,13 @@ describe("Patient Discharge based on multiple reason", () => {
patientPrescription.selectMedicine(patientMedicine);
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.wait(2000);
cy.closeNotification();
// submit the discharge pop-up
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
Comment on lines +107 to 115
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve test reliability and reusability

Two suggestions for improvement:

  1. Replace arbitrary waits with explicit assertions (same issue as previous comment).
  2. Consider extracting the medicine prescription flow into a reusable Cypress command.

Example implementation:

// In commands.ts
Cypress.Commands.add('prescribeMedicine', (medicine: string, dosage: string, frequency: string) => {
  cy.get('[data-cy=add-prescription]').click();
  cy.interceptMedibase();
  cy.get('[data-cy=medicine-box]').click();
  cy.get(`[data-cy=medicine-${medicine}]`).click();
  cy.get('[data-cy=dosage-input]').type(dosage);
  cy.get('[data-cy=frequency-select]').select(frequency);
  cy.clickSubmitButton('Submit');
  cy.get('.notification-toast').should('be.visible')
    .and('contain', 'Medicine prescribed');
});

// In test
cy.prescribeMedicine(patientMedicine, "4", "Twice daily");

This would make the test more maintainable and reusable across different test files.

cy.closeNotification();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientInvestigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("Patient Investigation Creation from Patient consultation page", () =>
"Haematology",
"Urine Test",
]);
cy.submitButton("Save Investigation");
cy.clickSubmitButton("Save Investigation");
cy.verifyNotification("Please Enter at least one value");
cy.closeNotification();
// Temporary workflow for investigation since we dont have dummy data and moving away from existing module
Comment on lines +31 to 34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add comprehensive test coverage for investigation workflow.

The current test implementation appears incomplete, as indicated by the comment. Consider enhancing the test coverage:

  1. Add validation for successful investigation creation
  2. Verify the investigation details after submission
  3. Test edge cases and error scenarios

Here's a suggested enhancement:

 cy.clickSubmitButton("Save Investigation");
 cy.verifyNotification("Please Enter at least one value");
 cy.closeNotification();
-// Temporary workflow for investigation since we dont have dummy data and moving away from existing module
+// Add investigation values
+patientInvestigation.fillInvestigationValues({
+  haematology: { value: "12.5", unit: "g/dL" },
+  urineTest: { value: "Normal", unit: "N/A" }
+});
+
+// Submit and verify
+cy.clickSubmitButton("Save Investigation");
+cy.verifyNotification("Investigation saved successfully");
+
+// Verify investigation details
+patientInvestigation.verifyInvestigationDetails({
+  type: ["Haematology", "Urine Test"],
+  status: "Completed"
+});

Committable suggestion skipped: line range outside the PR's diff.

Expand Down
40 changes: 20 additions & 20 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
Expand All @@ -74,7 +74,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.clickSubmitButton("Save");
cy.verifyNotification("Tele-medicine Log created successfully");
});

Expand Down Expand Up @@ -108,25 +108,25 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientPrescription.selectMedicine("DOLO");
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
cy.submitButton("Save and Continue");
cy.clickSubmitButton("Save and Continue");
cy.wait(2000);
Comment on lines +111 to 116
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace arbitrary wait with proper assertions

The test uses cy.wait(2000) which can lead to flaky tests. Instead, wait for specific elements or network requests to complete.

Improve the test stability:

  cy.clickSubmitButton("Submit");
+ cy.intercept('POST', '**/api/v1/prescriptions').as('createPrescription');
+ cy.intercept('POST', '**/api/v1/progress_notes').as('createProgressNote');
  cy.verifyNotification("Medicine prescribed");
  cy.closeNotification();
  cy.clickSubmitButton("Save and Continue");
- cy.wait(2000);
+ cy.wait('@createProgressNote').its('response.statusCode').should('eq', 201);
  cy.verifyNotification("Progress Note created successfully");

Committable suggestion skipped: line range outside the PR's diff.

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();
cy.submitButton("Update Details");
cy.clickSubmitButton("Update Details");
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
cy.closeNotification();
// Final Submission of the form
cy.submitButton("Complete");
cy.clickSubmitButton("Complete");
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
Expand All @@ -143,7 +143,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickUpdateDetail();
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.clickSubmitButton("Continue");
cy.verifyNotification("Progress Note updated successfully");
});

Expand All @@ -156,7 +156,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.selectRoundType("Detailed Update");
patientLogupdate.selectPatientCategory(patientCategory);
cy.submitButton("Save and Continue");
cy.clickSubmitButton("Save and Continue");
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
Expand All @@ -166,18 +166,18 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectOxygenSupport();
patientLogupdate.typeOxygenFlowRate(patientOxygenFlowRate);
patientLogupdate.typeVentilatorSpo2(patientSpo2);
cy.submitButton("Update Details");
cy.clickSubmitButton("Update Details");
cy.verifyNotification("Respiratory Support details succesfully updated.");
cy.closeNotification();
// Second Section will be Blood Sugar
patientLogupdate.selectCriticalCareSection("Blood Sugar");
patientLogupdate.typeBloodSugar(patientBloodSugar);
patientLogupdate.typeInsulinDosage(patientInsulinDosage);
cy.get("#insulin_intake_frequency-option-BD").click();
cy.submitButton("Update Details");
cy.clickSubmitButton("Update Details");
cy.verifyNotification("Blood Sugar details succesfully updated.");
// Submit the form and verify the details
cy.submitButton("Complete");
cy.clickSubmitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
cy.contains("button", "Log Updates").click();
Expand All @@ -203,10 +203,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectCriticalCareSection("Dialysis");
patientLogupdate.typeFluidBalance(patientFluidBalance);
patientLogupdate.typeNetBalance(patientNetBalance);
cy.submitButton("Update Details");
cy.clickSubmitButton("Update Details");
cy.verifyNotification("Dialysis details succesfully updated.");
cy.closeNotification();
cy.submitButton("Complete");
cy.clickSubmitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
//Reverify the editted and newly added data
Expand Down Expand Up @@ -251,7 +251,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.clickSubmitButton("Save");
cy.wait(2000);
cy.verifyNotification("Brief Update created successfully");
// Verify the card content
Expand All @@ -263,7 +263,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
Expand All @@ -281,7 +281,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.clickSubmitButton("Save");
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// edit the card and verify the data.
Expand All @@ -307,7 +307,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeSystolic(patientModifiedSystolic);
patientLogupdate.clearIntoElementById("#diastolic");
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.clickSubmitButton("Continue");
cy.verifyNotification("Brief Update updated successfully");
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
Expand All @@ -324,7 +324,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientPage.visitPatient(domicilaryPatient);
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientLogupdate.clickLogupdate();
Expand All @@ -336,7 +336,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeTemperature(patientTemperature);
patientLogupdate.typeRespiratory(patientRespiratory);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.submitButton("Save");
cy.clickSubmitButton("Save");
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["9"]);
Expand All @@ -346,7 +346,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
patientLogupdate.typePulse(patientPulse);
cy.submitButton("Save");
cy.clickSubmitButton("Save");
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
cy.verifyContentPresence("#consultation-buttons", ["-"]);
Expand Down
Loading
Loading