Skip to content

Commit

Permalink
fixed responsiveness and updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Sep 12, 2024
1 parent d8d89f1 commit e62e655
Show file tree
Hide file tree
Showing 43 changed files with 1,034 additions and 674 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stats.json
public/build-meta.json
.vscode/*
!.vscode/launch.json

src/supportedBrowsers.ts

# Reason React
/lib/bs/**
Expand Down
3 changes: 0 additions & 3 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"arrowParens": "always",
"tailwindFunctions": [
"classNames"
],
"plugins": [
"prettier-plugin-tailwindcss"
]
}
8 changes: 4 additions & 4 deletions cypress/e2e/assets_spec/assets_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("Asset", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25122021",
"25/12/2021",
"Test note for asset creation!",
);

Expand All @@ -77,7 +77,7 @@ describe("Asset", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25122021",
"25/12/2021",
"Test note for asset creation!",
);

Expand All @@ -104,7 +104,7 @@ describe("Asset", () => {
"Customer Support's Name Edited",
"Vendor's Name Edited",
"Test note for asset creation edited!",
"25122021",
"25/12/2021",
);

assetPage.clickUpdateAsset();
Expand Down Expand Up @@ -152,7 +152,7 @@ describe("Asset", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25122021",
"25/12/2021",
"Test note for asset creation!",
);
assetPage.interceptAssetCreation();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/assets_spec/assets_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("Asset", () => {
assetPage.clickupdatedetailbutton();
assetPage.scrollintonotes();
assetPage.enterAssetNotes("Dummy Notes");
assetPage.enterAssetservicedate("01092023");
assetPage.enterAssetservicedate("01/09/2023");
assetPage.clickassetupdatebutton();
assetPage.scrollintoservicehistory();
assetPage.clickedithistorybutton();
Expand Down
8 changes: 5 additions & 3 deletions cypress/e2e/external_results_spec/filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ describe("External Results Filters", () => {

it("filter by date", () => {
cy.get("input[name='created_date_start']").click();
cy.get("[id^='headlessui-popover-panel-'] .care-l-angle-left-b").click();
cy.get("[data-test-id='increment-date-range']").click();
cy.get("div[id='date-1']").click();
cy.get("div[id='date-8']").click();
cy.get("[data-test-id='slide-over-container']").click(0, 0);
cy.get("input[name='result_date_start']").click();
cy.get("[id^='headlessui-popover-panel-'] .care-l-angle-left-b").click();
cy.get("[data-test-id='increment-date-range']").click();
cy.get("div[id='date-1']").click();
cy.get("div[id='date-8']").click();
cy.get("[data-test-id='slide-over-container']").click(0, 0);
cy.get("input[name='sample_collection_date_start']").click();
cy.get("[id^='headlessui-popover-panel-'] .care-l-angle-left-b").click();
cy.get("[data-test-id='increment-date-range']").click();
cy.get("div[id='date-1']").click();
cy.get("div[id='date-8']").click();
cy.contains("Apply").click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Facility Creation", () => {
const facilityAddress = "cypress address";
const facilityUpdateAddress = "cypress updated address";
const facilityNumber = "9898469865";
const triageDate = "02122023";
const triageDate = "02/12/2023";
const initialTriageValue = "60";
const modifiedTriageValue = "50";
const facilityErrorMessage = [
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe("Location Management Section", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25122021",
"25/12/2021",
"Test note for asset creation!",
);
assetPage.clickassetupdatebutton();
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/patient_spec/patient_consultation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.selectPatientPrincipalDiagnosis(diagnosis4);
patientTreatmentPlan.clickAddProcedure();
patientTreatmentPlan.typeProcedureName(procedureName);
patientTreatmentPlan.typeProcedureTime("2024-02-22T12:30");
patientTreatmentPlan.typeProcedureTime("22/02/2024 12:30 pm");
patientTreatmentPlan.typeTreatmentPlan(patientTreatment);
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.typeSpecialInstruction(specialInstruction);
Expand Down Expand Up @@ -182,12 +182,12 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.typeCauseOfDeath("Cause of Death");
patientConsultationPage.typePatientConsultationDate(
"#death_datetime",
"2024-02-22T12:45",
"22/02/2024 12:30 pm",
);
patientConsultationPage.typeDeathConfirmedBy(doctorName);
patientConsultationPage.typePatientConsultationDate(
"#encounter_date",
"2024-02-22T12:30",
"22/02/2024 12:30 pm",
);
cy.submitButton("Create Consultation");
cy.verifyNotification(
Expand Down Expand Up @@ -245,7 +245,7 @@ describe("Patient Consultation in multiple combination", () => {
);
patientConsultationPage.typePatientConsultationDate(
"#icu_admission_date",
"2024-02-23T12:30",
"23/02/2024 12:30 pm",
);
// add investigation
patientInvestigation.clickAddInvestigation();
Expand Down Expand Up @@ -293,7 +293,7 @@ describe("Patient Consultation in multiple combination", () => {
);
// verify the free text in referring facility name
patientConsultationPage.typeReferringFacility("Life Care Hospital");
patientConsultationPage.selectSymptomsDate("01012024");
patientConsultationPage.selectSymptomsDate("01/01/2024");
patientConsultationPage.typeAndMultiSelectSymptoms("s", [
"Sore throat",
"Sputum",
Expand Down Expand Up @@ -338,7 +338,7 @@ describe("Patient Consultation in multiple combination", () => {
"Outpatient/Emergency Room",
);
// Select the Symptoms - Breathlessness and Bleeding symptoms
patientConsultationPage.selectSymptomsDate("01012024");
patientConsultationPage.selectSymptomsDate("01/01/2024");
patientConsultationPage.typeAndMultiSelectSymptoms("b", [
"Breathlessness",
"Bleeding",
Expand Down
113 changes: 105 additions & 8 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const patientSpo2 = "15";
const patientRhythmType = "Regular";
const patientRhythm = "Normal Rhythm";
const patientEtco2 = "50";
const patientOxygenFlowRate = "40";
const patientBloodSugar = "52";
const patientInsulinDosage = "56";
const patientFluidBalance = "500";
const patientNetBalance = "1000";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -39,6 +45,88 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.awaitUrl("/patients");
});

it("Create a basic critical care log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 10");
patientLogupdate.clickLogupdate();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed("Dummy Bed 2");
cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectRoundType("Detailed Update");
cy.submitButton("Save and Continue");
cy.verifyNotification("Detailed Update log created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
patientLogupdate.selectCriticalCareSection("Respiratory Support");
patientLogupdate.selectNoBilateralAirFlow();
patientLogupdate.typeEtco2(patientEtco2);
patientLogupdate.selectOxygenSupport();
patientLogupdate.typeOxygenFlowRate(patientOxygenFlowRate);
patientLogupdate.typeVentilatorSpo2(patientSpo2);
cy.submitButton("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.verifyNotification("Blood Sugar details succesfully updated.");
// Submit the form and verify the details
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
patientEtco2,
patientOxygenFlowRate,
]);
cy.verifyContentPresence("#blood-sugar", [
patientBloodSugar,
patientInsulinDosage,
]);
// Go back and edit the data on a third section
patientLogupdate.clickGoBackConsultation();
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateUpdateLog(
"#dailyround-entry",
patientCategory,
);
patientLogupdate.selectCriticalCareSection("Dialysis");
patientLogupdate.typeFluidBalance(patientFluidBalance);
patientLogupdate.typeNetBalance(patientNetBalance);
cy.submitButton("Update Details");
cy.verifyNotification("Dialysis details succesfully updated.");
cy.closeNotification();
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
//Reverify the editted and newly added data
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
patientEtco2,
patientOxygenFlowRate,
]);
cy.verifyContentPresence("#blood-sugar", [
patientBloodSugar,
patientInsulinDosage,
]);
cy.verifyContentPresence("#dialysis", [
patientFluidBalance,
patientNetBalance,
]);
});

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient("Dummy Patient 12");
patientLogupdate.clickLogupdate();
Expand All @@ -49,7 +137,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
// Only will be using random non-unique progress note fields
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.selectSymptomsDate("01/01/2024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.typeTemperature(patientTemperature);
// add diagnosis
Expand Down Expand Up @@ -77,7 +165,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Progress Note log created successfully");
cy.closeNotification();
// modify the relevant critical care log update
cy.contains("button", "Neurological Monitoring").click();
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");
Expand All @@ -91,7 +179,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientTemperature,
Expand All @@ -115,7 +206,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Telemedicine");
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.selectSymptomsDate("01/01/2024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
Expand All @@ -141,7 +232,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.selectSymptomsDate("01/01/2024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
Expand All @@ -158,7 +249,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.closeNotification();
// edit the card and verify the data.
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientCategory,
patientDiastolic,
Expand All @@ -179,7 +273,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.submitButton("Continue");
cy.verifyNotification("Brief Update log updated successfully");
cy.contains("button", "Daily Rounds").click();
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
patientModifiedDiastolic,
patientModifiedSystolic,
Expand All @@ -195,7 +292,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.selectSymptomsDate("01/01/2024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.selectPatientCategory(patientCategory);
Expand Down
14 changes: 6 additions & 8 deletions cypress/e2e/patient_spec/patient_registration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ const getRelativeDateString = (deltaDays = 0) => {
if (deltaDays) {
date.setDate(date.getDate() + deltaDays);
}
return date
.toLocaleDateString("en-IN", {
day: "2-digit",
month: "2-digit",
year: "numeric",
})
.replace("/", "");
return date.toLocaleDateString("en-IN", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
};

describe("Patient Creation with consultation", () => {
Expand All @@ -39,7 +37,7 @@ describe("Patient Creation with consultation", () => {
const phone_number = generatePhoneNumber();
const age = calculateAge();
const patientFacility = "Dummy Facility 40";
const patientDateOfBirth = "01012001";
const patientDateOfBirth = "01/01/2001";
const patientMenstruationStartDate = getRelativeDateString(-10);
const patientDateOfDelivery = getRelativeDateString(-20);
const patientOneName = "Patient With No Consultation";
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/resource_spec/filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe("Resource filter", () => {
cy.get("input[name='modified_date_start']").click();
cy.get("#date-1").click();
cy.get("#date-1").click();
cy.get("body").click(0, 0);
cy.contains("Apply").click();
cy.wait("@resource_filter");
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/users_spec/user_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("User Creation", () => {
userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14");
userCreationPage.typeIntoElementByIdPostClearDob(
"date_of_birth",
"01011998",
"01/01/1998",
);
userCreationPage.clickElementById("submit");
userCreationPage.verifyElementContainsText(
Expand Down Expand Up @@ -146,7 +146,7 @@ describe("User Creation", () => {
userCreationPage.typeIntoElementById("password", "Test@123");
userCreationPage.selectHomeFacility("Dummy Shifting Center");
userCreationPage.typeIntoElementById("phone_number", phone_number);
userCreationPage.setInputDate("date_of_birth", "date-input", "25081999");
userCreationPage.setInputDate("date_of_birth", "date-input", "25/08/1999");
userCreationPage.selectDropdownOption("user_type", "Doctor");
userCreationPage.typeIntoElementById("c_password", "Test@123");
userCreationPage.typeIntoElementById("doctor_qualification", "MBBS");
Expand Down
Loading

0 comments on commit e62e655

Please sign in to comment.