Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharsh05 committed Oct 30, 2023
2 parents 72e5b27 + 9005adf commit 740dd0b
Show file tree
Hide file tree
Showing 148 changed files with 6,260 additions and 2,687 deletions.
16 changes: 15 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
"plugin:i18next/recommended",
"plugin:tailwindcss/recommended"
],
"overrides": [
{
"files": [
"**/*.mdx"
],
"extends": [
"plugin:react/recommended",
"plugin:mdx/recommended"
],
"rules": {
"react/jsx-no-target-blank": "off",
"i18next/no-literal-string": "off"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
Expand Down Expand Up @@ -72,7 +87,6 @@
"*.res",
"*.css",
"*.csv",
"*.stories.mdx",
"Dockerfile"
]
}
31 changes: 31 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint Code Base

on:
pull_request:
branches:
- develop
- master
merge_group:

jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint -- --quiet
3 changes: 1 addition & 2 deletions cypress/e2e/assets_spec/asset_homepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe("Asset Tab", () => {
assetFilters.assertAssetTypeText("INTERNAL");
assetFilters.assertAssetClassText("ONVIF");
assetFilters.assertStatusText("ACTIVE");
assetFilters.assertLocationText("Camera Locations");
assetFilters.assertLocationText("Camera Loc");
assetFilters.clickadvancefilter();
assetFilters.clearFilters();
});
Expand All @@ -92,7 +92,6 @@ describe("Asset Tab", () => {
assetPage.importAssetFile();
assetPage.selectImportLocation("Camera Locations");
assetPage.clickImportAsset();
assetPage.verifySuccessNotification("Assets imported successfully");
});

it("verify imported asset", () => {
Expand Down
33 changes: 33 additions & 0 deletions cypress/e2e/assets_spec/assets_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";

function addDaysToDate(numberOfDays: number) {
const inputDate = new Date();
inputDate.setDate(inputDate.getDate() + numberOfDays);
return inputDate.toISOString().split("T")[0];
}

describe("Asset", () => {
const assetPage = new AssetPage();
const loginPage = new LoginPage();
Expand All @@ -26,6 +32,33 @@ describe("Asset", () => {
cy.awaitUrl("/assets");
});

it("Verify Asset Warranty Expiry Label", () => {
assetSearchPage.typeSearchKeyword(assetname);
assetSearchPage.pressEnter();
assetSearchPage.verifyBadgeContent(assetname);
assetSearchPage.clickAssetByName(assetname);
assetPage.clickupdatedetailbutton();
assetPage.scrollintoWarrantyDetails();
assetPage.enterWarrantyExpiryDate(addDaysToDate(100)); // greater than 3 months
assetPage.clickassetupdatebutton();
assetPage.verifyWarrantyExpiryLabel("");
assetPage.clickupdatedetailbutton();
assetPage.scrollintoWarrantyDetails();
assetPage.enterWarrantyExpiryDate(addDaysToDate(80)); // less than 3 months
assetPage.clickassetupdatebutton();
assetPage.verifyWarrantyExpiryLabel("3 months");
assetPage.clickupdatedetailbutton();
assetPage.scrollintoWarrantyDetails();
assetPage.enterWarrantyExpiryDate(addDaysToDate(20)); // less than 1 month
assetPage.clickassetupdatebutton();
assetPage.verifyWarrantyExpiryLabel("1 month");
assetPage.clickupdatedetailbutton();
assetPage.scrollintoWarrantyDetails();
assetPage.enterWarrantyExpiryDate(addDaysToDate(100)); // check for greater than 3 months again to verify the label is removed
assetPage.clickassetupdatebutton();
assetPage.verifyWarrantyExpiryLabel("");
});

it("Create & Edit a service history and verify reflection", () => {
assetSearchPage.typeSearchKeyword(assetname);
assetSearchPage.pressEnter();
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe("Location Management Section", () => {
cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
cy.get("[id='facility-details']").first().click();
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("h1.text-3xl.font-bold", { timeout: 10000 }).should("be.visible");
cy.get("#manage-facility-dropdown button").should("be.visible");
cy.get("[id='manage-facility-dropdown']").scrollIntoView().click();
cy.get("[id=location-management]").click();
Expand Down
17 changes: 16 additions & 1 deletion cypress/e2e/patient_spec/patient_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,27 @@ describe("Patient Creation with consultation", () => {
patientConsultationPage.interceptMediaBase();
patientConsultationPage.selectMedicinebox();
patientConsultationPage.waitForMediabaseStatusCode();
patientConsultationPage.prescribeMedicine();
patientConsultationPage.prescribefirstMedicine();
patientConsultationPage.enterDosage("3");
patientConsultationPage.selectDosageFrequency("Twice daily");
patientConsultationPage.submitPrescriptionAndReturn();
});

it("Edit created consultation to existing patient", () => {
updatePatientPage.visitUpdatedPatient();
patientConsultationPage.visitEditConsultationPage();
patientConsultationPage.fillIllnessHistory("editted");
patientConsultationPage.selectConsultationStatus(
"Referred from other hospital"
);
patientConsultationPage.updateSymptoms("FEVER");
patientConsultationPage.setSymptomsDate("01082023");
patientConsultationPage.updateConsultation();
patientConsultationPage.verifySuccessNotification(
"Consultation updated successfully"
);
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
78 changes: 78 additions & 0 deletions cypress/e2e/patient_spec/patient_manage.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
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";

describe("Patient", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientConsultationPage = new PatientConsultationPage();

before(() => {
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

beforeEach(() => {
cy.restoreLocalStorage();
cy.awaitUrl("/patients");
});

// it("Create Patient shift requests.", () => {
// patientPage.visitPatient();
// patientConsultationPage.visitShiftRequestPage();
// patientConsultationPage.enterPatientShiftDetails(
// "Test User",
// phone_number,
// "Dummy Shifting",
// "Reason"
// );
// patientConsultationPage.createShiftRequest();
// patientConsultationPage.verifySuccessNotification(
// "Shift request created successfully"
// );
// });
// commented out the shifting request, as logic need to be re-visited

it("Post doctor notes for an already created patient", () => {
patientPage.visitPatient();
patientConsultationPage.visitDoctorNotesPage();
patientConsultationPage.addDoctorsNotes("Test Doctor Notes");
patientConsultationPage.postDoctorNotes();
patientConsultationPage.verifySuccessNotification(
"Note added successfully"
);
});

it("Edit prescription for an already created patient", () => {
patientPage.visitPatient();
patientConsultationPage.visitEditPrescriptionPage();
patientConsultationPage.clickAddPrescription();
patientConsultationPage.interceptMediaBase();
patientConsultationPage.selectMedicinebox();
patientConsultationPage.waitForMediabaseStatusCode();
patientConsultationPage.prescribesecondMedicine();
patientConsultationPage.enterDosage("4");
patientConsultationPage.selectDosageFrequency("Twice daily");
patientConsultationPage.submitPrescription();
});

it("Upload consultations file ", () => {
patientPage.visitPatient();
patientConsultationPage.visitFilesPage();
patientConsultationPage.uploadFile();
patientConsultationPage.clickUploadFile();
});

it("Discharge a patient", () => {
patientPage.visitPatient();
patientConsultationPage.clickDischargePatient();
patientConsultationPage.selectDischargeReason("Recovered");
patientConsultationPage.addDischargeNotes("Discharge notes");
patientConsultationPage.confirmDischarge();
});

afterEach(() => {
cy.saveLocalStorage();
});
});
Loading

0 comments on commit 740dd0b

Please sign in to comment.