Skip to content

Commit

Permalink
Merge branch 'investigation-test' of https://github.com/ohcnetwork/ca…
Browse files Browse the repository at this point in the history
…re_fe into investigation-test
  • Loading branch information
nihal467 committed Nov 11, 2024
2 parents 7017dc9 + 4ce556c commit fc3eccd
Show file tree
Hide file tree
Showing 56 changed files with 1,380 additions and 766 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "care_fe",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-testing-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
}
if (isChangesRequired) {
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ cypress/fixtures/token.json
# Care Apps
/apps/*
src/pluginMap.ts
/apps_backup/*
36 changes: 0 additions & 36 deletions .husky/_/husky.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#build-stage
FROM --platform=$BUILDPLATFORM node:20-buster-slim as build-stage
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim as build-stage

WORKDIR /app

ENV NODE_OPTIONS="--max-old-space-size=4096"

RUN apt-get update && apt-get install -y git

RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then apt-get install -y python3-dev make g++; fi


COPY package.json package-lock.json ./

RUN npm install
Expand Down
11 changes: 6 additions & 5 deletions cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
import { v4 as uuidv4 } from "uuid";

import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import LoginPage from "../../pageobject/Login/LoginPage";
import { v4 as uuidv4 } from "uuid";

describe("Asset Tab", () => {
const assetSearchPage = new AssetSearchPage();
Expand Down
5 changes: 3 additions & 2 deletions cypress/e2e/assets_spec/AssetsCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { v4 as uuidv4 } from "uuid";
import LoginPage from "../../pageobject/Login/LoginPage";

import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("Asset", () => {
const assetPage = new AssetPage();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/assets_spec/AssetsManage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
import LoginPage from "../../pageobject/Login/LoginPage";

function addDaysToDate(numberOfDays: number) {
const inputDate = new Date();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import LoginPage from "../../pageobject/Login/LoginPage";
import ManageUserPage from "../../pageobject/Users/ManageUserPage";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";

Expand Down
60 changes: 53 additions & 7 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// FacilityCreation

import LoginPage from "../../pageobject/Login/LoginPage";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import FacilityNotify from "../../pageobject/Facility/FacilityNotify";
import LoginPage from "../../pageobject/Login/LoginPage";
import ManageUserPage from "../../pageobject/Users/ManageUserPage";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { UserPage } from "../../pageobject/Users/UserSearch";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";

describe("Facility Homepage Function", () => {
const loginPage = new LoginPage();
const facilityHome = new FacilityHome();
const facilityNotify = new FacilityNotify();
const facilityPage = new FacilityPage();
const manageUserPage = new ManageUserPage();
const userPage = new UserPage();
Expand All @@ -23,6 +24,8 @@ describe("Facility Homepage Function", () => {
const district = "Ernakulam";
const localBody = "Aikaranad";
const facilityType = "Private Hospital";
const notificationErrorMsg = "Message cannot be empty";
const notificationMessage = "Test Notification";

before(() => {
loginPage.loginAsDistrictAdmin();
Expand All @@ -31,6 +34,7 @@ describe("Facility Homepage Function", () => {

beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/facility");
});

Expand All @@ -42,9 +46,6 @@ describe("Facility Homepage Function", () => {
facilityHome.clickViewCnsButton();
facilityHome.verifyCnsUrl();
facilityHome.navigateBack();
// view notify button
facilityHome.clickFacilityNotifyButton();
facilityHome.verifyAndCloseNotifyModal();
// view facility button
facilityHome.clickViewFacilityDetails();
facilityPage.getFacilityName().should("be.visible");
Expand Down Expand Up @@ -135,6 +136,51 @@ describe("Facility Homepage Function", () => {
facilityHome.verifyLiveMonitorUrl();
});

it("Verify Notice Board Functionality", () => {
// search facility and verify it's loaded or not
manageUserPage.interceptFacilitySearchReq();
manageUserPage.typeFacilitySearch(facilityName);
manageUserPage.verifyFacilitySearchReq();
// verify facility name and card reflection
facilityNotify.verifyUrlContains("Dummy+Facility+40");
facilityPage.verifyFacilityBadgeContent(facilityName);
manageUserPage.assertFacilityInCard(facilityName);
// send notification to a facility
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
facilityNotify.fillNotifyText(notificationMessage);
facilityNotify.interceptPostNotificationReq();
cy.submitButton("Notify");
facilityNotify.verifyPostNotificationReq();
cy.verifyNotification("Facility Notified");
cy.closeNotification();
cy.wait(2000);
// Verify the frontend error on empty message
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
cy.submitButton("Notify");
facilityNotify.verifyErrorMessage(notificationErrorMsg);
// close pop-up and verify
facilityHome.verifyAndCloseNotifyModal();
// signout as district admin and login as a Nurse
loginPage.ensureLoggedIn();
loginPage.clickSignOutBtn();
loginPage.loginManuallyAsNurse();
// Verify Notice Board Reflection
facilityNotify.interceptGetNotificationReq("MESSAGE");
facilityNotify.visitNoticeBoard();
facilityNotify.verifyGetNotificationReq();
facilityNotify.verifyFacilityNoticeBoardMessage(notificationMessage);
facilityNotify.interceptGetNotificationReq();
// Verify Sidebar Notification Reflection
facilityNotify.openNotificationSlide();
facilityNotify.verifyGetNotificationReq();
cy.verifyContentPresence("#notification-slide-msg", [notificationMessage]);
facilityNotify.closeNotificationSlide();
loginPage.ensureLoggedIn();
loginPage.clickSignOutBtn();
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityInventory.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("Inventory Management Section", () => {
const facilityPage = new FacilityPage();
Expand Down
9 changes: 5 additions & 4 deletions cypress/e2e/facility_spec/FacilityLocation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { v4 as uuidv4 } from "uuid";

import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityLocation from "../../pageobject/Facility/FacilityLocation";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import { v4 as uuidv4 } from "uuid";
import FacilityLocation from "../../pageobject/Facility/FacilityLocation";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";

describe("Location Management Section", () => {
const assetPage = new AssetPage();
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/facility_spec/FacilityManage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityManage from "../../pageobject/Facility/FacilityManage";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { v4 as uuidv4 } from "uuid";

import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityManage from "../../pageobject/Facility/FacilityManage";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("Facility Manage Functions", () => {
const loginPage = new LoginPage();
const facilityManage = new FacilityManage();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientBedManagement.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";

describe("Patient swtich bed functionality", () => {
const loginPage = new LoginPage();
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";
import PatientPredefined from "../../pageobject/Patient/PatientPredefined";
import ShiftCreation from "../../pageobject/Shift/ShiftCreation";
import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation";
import PatientTreatmentPlan from "../../pageobject/Patient/PatientTreatmentPlan";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientDeathReport from "../../pageobject/Patient/PatientDeathReport";
import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation";
import PatientPredefined from "../../pageobject/Patient/PatientPredefined";
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";
import PatientTreatmentPlan from "../../pageobject/Patient/PatientTreatmentPlan";
import ShiftCreation from "../../pageobject/Shift/ShiftCreation";

describe("Patient Consultation in multiple combination", () => {
const patientConsultationPage = new PatientConsultationPage();
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DoctorConnect } from "pageobject/Patient/PatientDoctorConnect";

import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/PatientFileUpload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import { PatientFileUpload } from "../../pageobject/Patient/PatientFileupload";

const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientFileUpload = new PatientFileUpload();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate";
import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation";
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate";
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";

describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientPrescription.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientPrescription from "../../pageobject/Patient/PatientPrescription";

const patientPrescription = new PatientPrescription();
const loginPage = new LoginPage();
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { generatePhoneNumber } from "../../pageobject/utils/constants";
import PatientTransfer from "../../pageobject/Patient/PatientTransfer";
import PatientInsurance from "../../pageobject/Patient/PatientInsurance";
import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory";
import PatientTransfer from "../../pageobject/Patient/PatientTransfer";
import { generatePhoneNumber } from "../../pageobject/utils/constants";

const yearOfBirth = "2001";
const isHCXEnabled = Cypress.env("ENABLE_HCX");
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/resource_spec/ResourcesHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import ResourcePage from "../../pageobject/Resource/ResourcePage";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";

describe("Resource Page", () => {
let createdResource: string;
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { UserPage } from "../../pageobject/Users/UserSearch";
import LoginPage from "../../pageobject/Login/LoginPage";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import { UserPage } from "../../pageobject/Users/UserSearch";
import {
generatePhoneNumber,
generateEmergencyPhoneNumber,
generatePhoneNumber,
} from "../../pageobject/utils/constants";

describe("User Creation", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { UserPage } from "../../pageobject/Users/UserSearch";
import ManageUserPage from "../../pageobject/Users/ManageUserPage";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import { UserPage } from "../../pageobject/Users/UserSearch";

describe("Manage User", () => {
const loginPage = new LoginPage();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/UsersProfile.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import UserProfilePage from "../../pageobject/Users/UserProfilePage";
import ManageUserPage from "../../pageobject/Users/ManageUserPage";
import UserProfilePage from "../../pageobject/Users/UserProfilePage";

describe("Manage User Profile", () => {
const loginPage = new LoginPage();
Expand Down
3 changes: 2 additions & 1 deletion cypress/pageobject/Facility/FacilityHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class FacilityHome {
}

clickFacilityNotifyButton() {
cy.get("#facility-notify").first().click();
cy.get("#facility-notify", { timeout: 10000 }).should("be.visible");
cy.get("#facility-notify").focus().click();
}

clickLiveMonitorButton() {
Expand Down
Loading

0 comments on commit fc3eccd

Please sign in to comment.