Skip to content

Commit

Permalink
Merge pull request #8552 from ohcnetwork/staging
Browse files Browse the repository at this point in the history
Production Release v24.38.0
  • Loading branch information
sainak authored Sep 17, 2024
2 parents a6f1c69 + a67c84a commit 46259c1
Show file tree
Hide file tree
Showing 155 changed files with 4,266 additions and 450 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ stats.json
public/build-meta.json
.vscode/*
!.vscode/launch.json
src/supportedBrowsers.ts


# Reason React
# Reason React
/lib/bs/**
.merlin
*.bs.js
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"
]
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
```sh
npm install
```
#### Run the following command to generate the `supportedBrowsers.ts` file:

```bash
npm run supported-browsers
```
This script just generates regex expression for matching the list of compatible browsers, so that we can show a warning notification for unsupported browsers.

#### 🏃 Run the app in development mode

Expand Down
2 changes: 2 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
files:
- source: /src/Locale/en/*.json
translation: /src/Locale/%two_letters_code%/%original_file_name%
bundles:
- 2
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ describe("Edit Profile Testing", () => {
cy.get("div").contains("Import/Export").click();
cy.get("div").contains("Import Results").click();
cy.get("[data-testid=import-file]")
.selectFile("cypress/fixtures/externalresultsample.csv", { force: true })
.selectFile("cypress/fixtures/external-result-sample.csv", {
force: true,
})
.wait(100);
cy.submitButton("Import");
cy.wait("@import").then((interception) => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("Facility Manage Functions", () => {
// It's only button functionality because we can't access S3 bucket in local
facilityManage.clickCoverImage();
facilityManage.verifyUploadButtonVisible();
facilityManage.uploadCoverImage("facilitycoverimage.jpg");
facilityManage.uploadCoverImage("facility-cover-image.jpg");
facilityManage.clickSaveCoverImage();
});

Expand Down
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 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 Down Expand Up @@ -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 Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ import { UserPage } from "../../pageobject/Users/UserSearch";

describe("User Homepage", () => {
const userPage = new UserPage();
const usernameToTest = "devdoctor";
const currentuser = "devdistrictadmin";
const loginPage = new LoginPage();
const phone_number = "9876543219";
const alt_phone_number = "9876543219";
const currentuser = "devdistrictadmin";
const firstName = "Dummy";
const lastName = "Nurse";
const role = "Nurse";
const state = "Kerala";
const district = "Ernakulam";
const phoneNumber = "8878825662";
const altPhoneNumber = "8878825662";
const homeFacility = "Dummy Facility 40";
const nurseUserName = "dummynurse1";
const doctorUserName = "devdoctor";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -22,33 +29,32 @@ describe("User Homepage", () => {

it("User advance filter functionality", () => {
userPage.clickAdvancedFilters();
userPage.typeInFirstName("Dev");
userPage.typeInLastName("Doctor");
userPage.selectRole("Doctor");
userPage.selectState("Kerala");
userPage.selectDistrict("Ernakulam");
userPage.typeInPhoneNumber(phone_number);
userPage.typeInAltPhoneNumber(alt_phone_number);
userPage.selectHomeFacility("Dummy Facility 40");
userPage.typeInFirstName(firstName);
userPage.typeInLastName(lastName);
userPage.selectRole(role);
userPage.selectState(state);
userPage.selectDistrict(district);
userPage.typeInPhoneNumber(phoneNumber);
userPage.typeInAltPhoneNumber(altPhoneNumber);
userPage.selectHomeFacility(homeFacility);
userPage.applyFilter();
userPage.verifyUrlafteradvancefilter();
userPage.checkUsernameText(usernameToTest);
userPage.verifyDataTestIdText("First Name", "First Name: Dev");
userPage.verifyDataTestIdText("Last Name", "Last Name: Doctor");
userPage.checkUsernameText(nurseUserName);
// Verify the badges related to the data
userPage.verifyDataTestIdText("First Name", `First Name: ${firstName}`);
userPage.verifyDataTestIdText("Last Name", `Last Name: ${lastName}`);
userPage.verifyDataTestIdText(
"Phone Number",
"Phone Number: +919876543219",
`Phone Number: +91${phoneNumber}`,
);
userPage.verifyDataTestIdText(
"WhatsApp no.",
"WhatsApp no.: +919876543219",
`WhatsApp no.: +91${altPhoneNumber}`,
);
userPage.verifyDataTestIdText("Role", "Role: Doctor");
userPage.verifyDataTestIdText("Role", `Role: ${role}`);
userPage.verifyDataTestIdText(
"Home Facility",
"Home Facility: Dummy Facility 40",
`Home Facility: ${homeFacility}`,
);
userPage.verifyDataTestIdText("District", "District: Ernakulam");
userPage.clearFilters();
userPage.verifyDataTestIdNotVisible("First Name");
userPage.verifyDataTestIdNotVisible("Last Name");
Expand All @@ -61,14 +67,14 @@ describe("User Homepage", () => {

it("Search by username", () => {
userPage.checkSearchInputVisibility();
userPage.typeInSearchInput(usernameToTest);
userPage.checkUrlForUsername(usernameToTest);
userPage.checkUsernameText(usernameToTest);
userPage.typeInSearchInput(doctorUserName);
userPage.checkUrlForUsername(doctorUserName);
userPage.checkUsernameText(doctorUserName);
userPage.checkUsernameBadgeVisibility(true);
userPage.clearSearchInput();
userPage.checkUsernameBadgeVisibility(false);
userPage.typeInSearchInput(usernameToTest);
userPage.checkUsernameText(usernameToTest);
userPage.typeInSearchInput(doctorUserName);
userPage.checkUsernameText(doctorUserName);
userPage.clickRemoveIcon();
userPage.checkUsernameBadgeVisibility(false);
userPage.checkUsernameText(currentuser);
Expand Down
Loading

0 comments on commit 46259c1

Please sign in to comment.