-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Cypress Test | Normal Log Update for Admission and Non- Admission…
… Patients | Patient Consultation Module (#7400) * log update * log update * updated the additional symptoms * Normal log update modification part done * pre-final part * pre-final part * final change * flaky test * syntax error * added wait * added scrollinto view * added wait * fixing scroll * revert canvas verification
- Loading branch information
Showing
14 changed files
with
279 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; | ||
import { PatientPage } from "../../pageobject/Patient/PatientCreation"; | ||
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate"; | ||
|
||
describe("Patient Log Update in Normal, Critical and TeleIcu", () => { | ||
const loginPage = new LoginPage(); | ||
const patientConsultationPage = new PatientConsultationPage(); | ||
const patientPage = new PatientPage(); | ||
const patientLogupdate = new PatientLogupdate(); | ||
const domicilaryPatient = "Dummy Patient 11"; | ||
const patientCategory = "Abnormal"; | ||
const additionalSymptoms = "ASYMPTOMATIC"; | ||
const physicalExamination = "physical examination details"; | ||
const otherExamination = "Other"; | ||
const patientSystolic = "119"; | ||
const patientDiastolic = "150"; | ||
const patientModifiedSystolic = "120"; | ||
const patientModifiedDiastolic = "145"; | ||
const patientPulse = "152"; | ||
const patientTemperature = "96.6"; | ||
const patientRespiratory = "140"; | ||
const patientSpo2 = "15"; | ||
const patientRhythmType = "Regular"; | ||
const patientRhythm = "Normal Rhythm"; | ||
|
||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/patients"); | ||
}); | ||
|
||
it("Create a new log teleicu update for a domicilary care patient and verify the copy previous value function", () => { | ||
patientPage.visitPatient("Dummy Patient 11"); | ||
patientConsultationPage.clickEditConsultationButton(); | ||
patientConsultationPage.selectPatientSuggestion("Domiciliary Care"); | ||
cy.submitButton("Update Consultation"); | ||
cy.verifyNotification("Consultation updated successfully"); | ||
patientLogupdate.clickLogupdate(); | ||
patientLogupdate.typePhysicalExamination(physicalExamination); | ||
patientLogupdate.typeOtherDetails(otherExamination); | ||
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms); | ||
patientLogupdate.selectPatientCategory(patientCategory); | ||
patientLogupdate.typeSystolic(patientSystolic); | ||
patientLogupdate.typeDiastolic(patientDiastolic); | ||
patientLogupdate.typePulse(patientPulse); | ||
patientLogupdate.typeTemperature(patientTemperature); | ||
patientLogupdate.typeRespiratory(patientRespiratory); | ||
patientLogupdate.typeSpo2(patientSpo2); | ||
patientLogupdate.selectRhythm(patientRhythmType); | ||
patientLogupdate.typeRhythm(patientRhythm); | ||
cy.get("#consciousness_level-2").click(); | ||
cy.submitButton("Save"); | ||
cy.verifyNotification("Consultation Updates details created successfully"); | ||
// verify the copied previous value | ||
cy.closeNotification(); | ||
patientLogupdate.clickLogupdate(); | ||
patientLogupdate.clickCopyPreviousValue(); | ||
patientLogupdate.selectPatientCategory(patientCategory); | ||
cy.submitButton("Save"); | ||
cy.closeNotification(); | ||
cy.verifyContentPresence("#physical_examination_info", [ | ||
physicalExamination, | ||
]); | ||
cy.verifyContentPresence("#rhythm_detail", [patientRhythm]); | ||
cy.submitButton("Continue"); | ||
cy.verifyNotification("Consultation Updates details updated successfully"); | ||
}); | ||
|
||
it("Create a new log normal update for a domicilary care patient and edit it", () => { | ||
patientPage.visitPatient(domicilaryPatient); | ||
patientConsultationPage.clickEditConsultationButton(); | ||
patientConsultationPage.selectPatientSuggestion("Domiciliary Care"); | ||
cy.submitButton("Update Consultation"); | ||
cy.verifyNotification("Consultation updated successfully"); | ||
patientLogupdate.clickLogupdate(); | ||
patientLogupdate.typePhysicalExamination(physicalExamination); | ||
patientLogupdate.typeOtherDetails(otherExamination); | ||
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms); | ||
patientLogupdate.selectPatientCategory(patientCategory); | ||
patientLogupdate.typeSystolic(patientSystolic); | ||
patientLogupdate.typeDiastolic(patientDiastolic); | ||
patientLogupdate.typePulse(patientPulse); | ||
patientLogupdate.typeTemperature(patientTemperature); | ||
patientLogupdate.typeRespiratory(patientRespiratory); | ||
patientLogupdate.typeSpo2(patientSpo2); | ||
patientLogupdate.selectRhythm(patientRhythmType); | ||
patientLogupdate.typeRhythm(patientRhythm); | ||
cy.get("#consciousness_level-2").click(); | ||
cy.submitButton("Save"); | ||
cy.verifyNotification("Consultation Updates details created successfully"); | ||
// edit the card and verify the data. | ||
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory); | ||
cy.verifyContentPresence("#consultation-preview", [ | ||
patientCategory, | ||
patientDiastolic, | ||
patientSystolic, | ||
physicalExamination, | ||
otherExamination, | ||
patientPulse, | ||
patientTemperature, | ||
patientRespiratory, | ||
patientSpo2, | ||
patientRhythm, | ||
]); | ||
patientLogupdate.clickUpdateDetail(); | ||
patientLogupdate.clickClearButtonInElement("#systolic"); | ||
patientLogupdate.typeSystolic(patientModifiedSystolic); | ||
patientLogupdate.clickClearButtonInElement("#diastolic"); | ||
patientLogupdate.typeDiastolic(patientModifiedDiastolic); | ||
cy.submitButton("Continue"); | ||
cy.verifyNotification("Consultation Updates details updated successfully"); | ||
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory); | ||
cy.verifyContentPresence("#consultation-preview", [ | ||
patientModifiedDiastolic, | ||
patientModifiedSystolic, | ||
]); | ||
}); | ||
|
||
it("Create a new log normal update for a admission patient and verify its reflection in cards", () => { | ||
patientPage.visitPatient("Dummy Patient 13"); | ||
patientLogupdate.clickLogupdate(); | ||
cy.verifyNotification("Please assign a bed to the patient"); | ||
patientLogupdate.selectBed("Dummy Bed 6"); | ||
cy.closeNotification(); | ||
patientLogupdate.clickLogupdate(); | ||
patientLogupdate.typePhysicalExamination(physicalExamination); | ||
patientLogupdate.typeOtherDetails(otherExamination); | ||
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms); | ||
patientLogupdate.selectPatientCategory(patientCategory); | ||
patientLogupdate.typeSystolic(patientSystolic); | ||
patientLogupdate.typeDiastolic(patientDiastolic); | ||
patientLogupdate.typePulse(patientPulse); | ||
patientLogupdate.typeTemperature(patientTemperature); | ||
patientLogupdate.typeRespiratory(patientRespiratory); | ||
patientLogupdate.typeSpo2(patientSpo2); | ||
patientLogupdate.selectRhythm(patientRhythmType); | ||
patientLogupdate.typeRhythm(patientRhythm); | ||
cy.get("#consciousness_level-2").click(); | ||
cy.submitButton("Save"); | ||
cy.verifyNotification("Consultation Updates details created successfully"); | ||
// Verify the card content | ||
cy.get("#basic-information").scrollIntoView(); | ||
cy.verifyContentPresence("#basic-information", [additionalSymptoms]); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
class PatientLogupdate { | ||
clickLogupdate() { | ||
cy.get("#log-update").scrollIntoView(); | ||
cy.verifyAndClickElement("#log-update", "Log Update"); | ||
cy.wait(2000); | ||
} | ||
|
||
selectBed(bed: string) { | ||
cy.searchAndSelectOption("input[name='bed']", bed); | ||
cy.submitButton("Move to bed"); | ||
cy.wait(2000); | ||
} | ||
|
||
selectPatientCategory(category: string) { | ||
cy.clickAndSelectOption("#patient_category", category); | ||
} | ||
|
||
typePhysicalExamination(examination: string) { | ||
cy.get("#physical_examination_info").click().type(examination); | ||
cy.get("#physical_examination_info").should("contain", examination); | ||
} | ||
|
||
typeOtherDetails(details: string) { | ||
cy.get("#other_details").click().type(details); | ||
} | ||
|
||
typeAdditionalSymptoms(symptoms: string) { | ||
cy.clickAndSelectOption("#additional_symptoms", symptoms); | ||
} | ||
|
||
typeSystolic(systolic: string) { | ||
cy.searchAndSelectOption("#systolic", systolic); | ||
} | ||
|
||
typeDiastolic(diastolic: string) { | ||
cy.searchAndSelectOption("#diastolic", diastolic); | ||
} | ||
|
||
typePulse(pulse: string) { | ||
cy.searchAndSelectOption("#pulse", pulse); | ||
} | ||
|
||
typeTemperature(temperature: string) { | ||
cy.searchAndSelectOption("#temperature", temperature); | ||
} | ||
|
||
typeRespiratory(respiratory: string) { | ||
cy.searchAndSelectOption("#resp", respiratory); | ||
} | ||
|
||
typeSpo2(spo: string) { | ||
cy.searchAndSelectOption("#ventilator_spo2", spo); | ||
} | ||
|
||
selectRhythm(rhythm: string) { | ||
cy.clickAndSelectOption("#rhythm", rhythm); | ||
} | ||
|
||
typeRhythm(rhythm: string) { | ||
cy.get("#rhythm_detail").click().type(rhythm); | ||
} | ||
|
||
clickLogupdateCard(element, patientCategory) { | ||
cy.get(element).scrollIntoView(); | ||
cy.verifyContentPresence(element, [patientCategory]); | ||
cy.get(element).first().contains("View Details").click(); | ||
cy.wait(3000); | ||
} | ||
|
||
clickUpdateDetail() { | ||
cy.verifyAndClickElement("#consultation-preview", "Update Details"); | ||
cy.wait(3000); | ||
} | ||
|
||
clickClearButtonInElement(elementId) { | ||
cy.get(elementId).find("#clear-button").click(); | ||
} | ||
|
||
clickVitals() { | ||
cy.get("#consultation_tab_nav").scrollIntoView(); | ||
cy.verifyAndClickElement("#consultation_tab_nav", "Vitals"); | ||
} | ||
|
||
clickCopyPreviousValue() { | ||
cy.get("#clone_last").click(); | ||
} | ||
} | ||
export default PatientLogupdate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.