-
Notifications
You must be signed in to change notification settings - Fork 522
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
Changes from 35 commits
1511f69
8f5448d
36b1ceb
66bfe4a
c37f252
3b731aa
b9edb9b
a03ce0d
c6e12eb
e1ffd14
e89ec71
a882727
988fbb1
f7e9ef3
7f8a699
641137a
a283e5b
71f893e
b4bb3f5
ac4ee22
95de134
62e4f5d
52f794a
a2627cc
81a1ae8
b184a12
4135708
ac10909
8d4bd40
8a73752
1b8b464
9b8a8f8
6369c15
a38fab3
1ec01aa
b220acd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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(); | ||||||||||||||||||
|
@@ -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); | ||||||||||||||||||
cy.verifyNotification("Medicine prescribed"); | ||||||||||||||||||
patientPrescription.clickReturnToDashboard(); | ||||||||||||||||||
|
@@ -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", | ||||||||||||||||||
); | ||||||||||||||||||
|
@@ -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( | ||||||||||||||||||
|
@@ -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"); | ||||||||||||||||||
|
@@ -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( | ||||||||||||||||||
|
@@ -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( | ||||||||||||||||||
|
@@ -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"); | ||||||||||||||||||
}); | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
|
||||||||||||||||||
patientConsultationPage.verifyTextInConsultation( | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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");
|
||
cy.verifyNotification("Patient Discharged Successfully"); | ||
cy.closeNotification(); | ||
// Verify the consultation dashboard reflection | ||
|
@@ -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 | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace arbitrary waits with proper assertions Using fixed timeouts ( 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");
|
||
cy.closeNotification(); | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve test reliability and reusability Two suggestions for improvement:
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(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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"
+});
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
|
@@ -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"); | ||
}); | ||
|
||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace arbitrary wait with proper assertions The test uses 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");
|
||
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 | ||
|
@@ -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"); | ||
}); | ||
|
||
|
@@ -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 | ||
|
@@ -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(); | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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(); | ||
|
@@ -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. | ||
|
@@ -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( | ||
|
@@ -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(); | ||
|
@@ -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"]); | ||
|
@@ -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", ["-"]); | ||
|
There was a problem hiding this comment.
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.