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

Added support for time in dateinput component #8504

Merged
merged 28 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
909d821
Added support for time in dateinput
shivankacker Sep 8, 2024
d8d89f1
made responsive
shivankacker Sep 8, 2024
e62e655
fixed responsiveness and updated tests
shivankacker Sep 12, 2024
e9ee7c3
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
shivankacker Sep 12, 2024
248afe9
Fixed scroll behaviour
shivankacker Sep 12, 2024
435484d
minor test fix
shivankacker Sep 12, 2024
060b271
Updated placeholder, changed layout of time picker on mobile, and mad…
shivankacker Sep 13, 2024
3f52db1
Made fool proof
shivankacker Sep 13, 2024
e54004e
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
shivankacker Sep 17, 2024
e88adba
fix merge conflicts
shivankacker Sep 19, 2024
b46694d
stashing
shivankacker Sep 20, 2024
1f0d1f7
fix merge conflicts
shivankacker Oct 4, 2024
86663d8
fix merge conflicts
shivankacker Oct 9, 2024
16aa346
updated UI to not have the user add slashes
shivankacker Oct 10, 2024
c3162fb
updated tests
shivankacker Oct 11, 2024
e5480f3
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
shivankacker Oct 11, 2024
79cdb31
fixed tests
shivankacker Oct 12, 2024
1bd3e32
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
shivankacker Oct 14, 2024
149e6b6
fix responsiveness
shivankacker Oct 14, 2024
4b7adcc
fix merge conflicts
shivankacker Oct 17, 2024
5e69cf0
fixed bugs
shivankacker Oct 17, 2024
fe68ada
fixed merge conflicts and updated tests
shivankacker Oct 22, 2024
e5950f5
little mistake
shivankacker Oct 22, 2024
ceaf273
autoclose on first date input
shivankacker Oct 23, 2024
f47f372
fix merge conflicts
shivankacker Oct 24, 2024
2f9bd97
fix merge conflicts
shivankacker Oct 24, 2024
d5f0683
cleanup
shivankacker Oct 25, 2024
c3c1727
fixed merge conflicts
shivankacker Oct 28, 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
Prev Previous commit
Next Next commit
updated tests
shivankacker committed Oct 11, 2024
commit c3162fb02914c5921d4cb619cbbe6003a0342b85
8 changes: 4 additions & 4 deletions cypress/e2e/assets_spec/AssetsCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ describe("Asset", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25/12/2021",
"25122021",
"Test note for asset creation!",
);

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

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

assetPage.clickUpdateAsset();
@@ -152,7 +152,7 @@ describe("Asset", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25/12/2021",
"25122021",
"Test note for asset creation!",
);
assetPage.interceptAssetCreation();
2 changes: 1 addition & 1 deletion cypress/e2e/assets_spec/AssetsManage.cy.ts
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ describe("Asset", () => {
assetPage.clickupdatedetailbutton();
assetPage.scrollintonotes();
assetPage.enterAssetNotes("Dummy Notes");
assetPage.enterAssetservicedate("01/09/2023");
assetPage.enterAssetservicedate("01092023");
assetPage.clickassetupdatebutton();
assetPage.scrollintoservicehistory();
assetPage.clickedithistorybutton();
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ describe("Facility Creation", () => {
const facilityAddress = "cypress address";
const facilityUpdateAddress = "cypress updated address";
const facilityNumber = "9898469865";
const triageDate = "02/12/2023";
const triageDate = "02122023";
const initialTriageValue = "60";
const modifiedTriageValue = "50";
const facilityErrorMessage = [
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityLocation.cy.ts
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ describe("Location Management Section", () => {
"[email protected]",
"Vendor's Name",
serialNumber,
"25/12/2021",
"25122021",
"Test note for asset creation!",
);
assetPage.clickassetupdatebutton();
12 changes: 6 additions & 6 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.selectPatientPrincipalDiagnosis(diagnosis4);
patientTreatmentPlan.clickAddProcedure();
patientTreatmentPlan.typeProcedureName(procedureName);
patientTreatmentPlan.typeProcedureTime("22/02/2024 12:30 pm");
patientTreatmentPlan.typeProcedureTime("220220241230");
patientTreatmentPlan.typeTreatmentPlan(patientTreatment);
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.typeSpecialInstruction(specialInstruction);
@@ -182,12 +182,12 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.typeCauseOfDeath("Cause of Death");
patientConsultationPage.typePatientConsultationDate(
"#death_datetime",
"22/02/2024 12:30 pm",
"220220241230",
);
patientConsultationPage.typeDeathConfirmedBy(doctorName);
patientConsultationPage.typePatientConsultationDate(
"#encounter_date",
"22/02/2024 12:30 pm",
"220220241230",
);
cy.submitButton("Create Consultation");
cy.verifyNotification(
@@ -245,7 +245,7 @@ describe("Patient Consultation in multiple combination", () => {
);
patientConsultationPage.typePatientConsultationDate(
"#icu_admission_date",
"23/02/2024 12:30 pm",
"230220241230",
);
// add investigation
patientInvestigation.clickAddInvestigation();
@@ -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("01/01/2024");
patientConsultationPage.selectSymptomsDate("01012024");
patientConsultationPage.typeAndMultiSelectSymptoms("s", [
"Sore throat",
"Sputum",
@@ -338,7 +338,7 @@ describe("Patient Consultation in multiple combination", () => {
"Outpatient/Emergency Room",
);
// Select the Symptoms - Breathlessness and Bleeding symptoms
patientConsultationPage.selectSymptomsDate("01/01/2024");
patientConsultationPage.selectSymptomsDate("01012024");
patientConsultationPage.typeAndMultiSelectSymptoms("b", [
"Breathlessness",
"Bleeding",
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
@@ -238,7 +238,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01/01/2024");
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.typeSystolic(patientSystolic);
@@ -268,7 +268,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01/01/2024");
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
12 changes: 7 additions & 5 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
@@ -19,11 +19,13 @@ const getRelativeDateString = (deltaDays = 0) => {
if (deltaDays) {
date.setDate(date.getDate() + deltaDays);
}
return date.toLocaleDateString("en-IN", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
return date
.toLocaleDateString("en-IN", {
day: "2-digit",
month: "2-digit",
year: "numeric",
})
.replace("/", "");
};

describe("Patient Creation with consultation", () => {
4 changes: 2 additions & 2 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ describe("User Creation", () => {
userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14");
userCreationPage.typeIntoElementByIdPostClearDob(
"date_of_birth",
"01/01/1998",
"01011998",
);
userCreationPage.clickElementById("submit");
userCreationPage.verifyElementContainsText(
@@ -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", "25/08/1999");
userCreationPage.setInputDate("date_of_birth", "25081999");
userCreationPage.selectDropdownOption("user_type", "Doctor");
userCreationPage.typeIntoElementById("c_password", "Test@123");
userCreationPage.typeIntoElementById("qualification", "MBBS");
82 changes: 0 additions & 82 deletions cypress/e2e/users_spec/user_profile.cy.ts

This file was deleted.

15 changes: 12 additions & 3 deletions cypress/pageobject/Asset/AssetCreation.ts
Original file line number Diff line number Diff line change
@@ -62,7 +62,9 @@ export class AssetPage {
cy.get(
"[data-testid=asset-last-serviced-on-input] input[type='text']",
).click();
cy.get("#date-input").click().type(lastServicedOn);
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click(0, 0)
.type(lastServicedOn);
cy.get("body").click(0, 0);
shivankacker marked this conversation as resolved.
Show resolved Hide resolved
cy.get("[data-testid=asset-notes-input] textarea").type(notes);
}
@@ -121,7 +123,12 @@ export class AssetPage {
cy.get(
"[data-testid=asset-last-serviced-on-input] input[type='text']",
).click();
cy.get("#date-input").click().clear().type(lastServicedOn);
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(lastServicedOn);
cy.get("body").click(0, 0);
shivankacker marked this conversation as resolved.
Show resolved Hide resolved
cy.get("[data-testid=asset-notes-input] textarea").clear().type(notes);
}
@@ -278,7 +285,9 @@ export class AssetPage {

enterAssetservicedate(text: string) {
cy.get("input[name='last_serviced_on']").click();
cy.get("#date-input").click().type(text);
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(text);
cy.get("body").click(0, 0);
shivankacker marked this conversation as resolved.
Show resolved Hide resolved
}

4 changes: 3 additions & 1 deletion cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
@@ -246,7 +246,9 @@ class FacilityPage {

fillEntryDate(date) {
cy.get("#entry_date").click();
cy.get("#date-input").click().type(date);
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(date);
cy.get("body").click(0, 0);
shivankacker marked this conversation as resolved.
Show resolved Hide resolved
}

7 changes: 6 additions & 1 deletion cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
@@ -61,7 +61,12 @@ export class PatientConsultationPage {

typePatientConsultationDate(selector: string, date: string) {
cy.get(selector).click();
cy.get("#date-input").clear().type(date);
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(date);
cy.get("body").click(0, 0);
shivankacker marked this conversation as resolved.
Show resolved Hide resolved
}

12 changes: 9 additions & 3 deletions cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
@@ -54,7 +54,9 @@ export class PatientPage {
cy.clickAndSelectOption("#patientAge", "DOB");
cy.get("#date_of_birth").scrollIntoView();
cy.get("#date_of_birth").should("be.visible").click();
cy.get("#date-input").click().type(dateOfBirth);
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(dateOfBirth);
cy.get("body").click(0, 0);
}

@@ -82,13 +84,17 @@ export class PatientPage {

typeLastMenstruationStartDate(date: string) {
cy.get("#last_menstruation_start_date").click();
cy.get("#date-input").click().type(date);
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(date);
cy.get("body").click(0, 0);
}

typeDateOfDelivery(date: string) {
cy.get("#date_of_delivery").click();
cy.get("#date-input").click().type(date);
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(date);
cy.get("body").click(0, 0);
}

2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientPredefined.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class PatientPredefined {
const emergency_phone_number = generateEmergencyPhoneNumber();
patientPage.typePatientPhoneNumber(phone_number);
patientPage.typePatientEmergencyNumber(emergency_phone_number);
patientPage.typePatientDateOfBirth("01/01/2001");
patientPage.typePatientDateOfBirth("01012001");
patientPage.typePatientName("Patient With Predefined Data");
patientPage.selectPatientGender("Male");
patientPage.typePatientAddress("Test Patient Address");
7 changes: 6 additions & 1 deletion cypress/pageobject/Patient/PatientTreatmentPlan.ts
Original file line number Diff line number Diff line change
@@ -34,7 +34,12 @@ class PatientTreatmentPlan {

typeProcedureTime(time: string) {
cy.get("#procedure-time").click();
cy.get("#date-input").clear().type(time);
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(time);
cy.get("body").click(0, 0);
}

15 changes: 8 additions & 7 deletions cypress/pageobject/Users/UserCreation.ts
Original file line number Diff line number Diff line change
@@ -19,7 +19,12 @@ export class UserCreationPage {
}
typeIntoElementByIdPostClearDob(elementId: string, value: string) {
cy.get("#" + elementId).click();
cy.get("#date-input").clear().type(value);
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(value);
}
clearIntoElementById(elementId: string) {
cy.get("#" + elementId)
@@ -54,13 +59,9 @@ export class UserCreationPage {
this.selectOptionContainingText(name);
}

setInputDate(
dateElementId: string,
inputElementId: string,
dateValue: string,
) {
setInputDate(dateElementId: string, dateValue: string) {
this.clickElementById(dateElementId);
this.typeIntoElementById(inputElementId, dateValue);
cy.get(`[data-test-id="date-input"]:visible`).click().type(dateValue);
}

selectDropdownOption(dropdownId: string, optionText: string) {
Loading