Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into sainak/feat/use-ma…
Browse files Browse the repository at this point in the history
…naged-media-source
  • Loading branch information
sainak committed Sep 17, 2024
2 parents 5828bbc + b54bcc5 commit b81047e
Show file tree
Hide file tree
Showing 177 changed files with 4,458 additions and 603 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// <reference types="cypress" />

import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
Expand Down Expand Up @@ -65,7 +62,7 @@ describe("Asset Tab", () => {
"Dummy Facility 40",
"ACTIVE",
"ONVIF Camera",
"Camera Loc"
"Camera Loc",
);
assetFilters.clickadvancefilter();
assetFilters.clickslideoverbackbutton(); // to verify the back button doesn't clear applied filters
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference types="cypress" />
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { v4 as uuidv4 } from "uuid";
import LoginPage from "../../pageobject/Login/LoginPage";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { cy, describe, beforeEach, it } from "local-cypress";

describe("Forgot Password", () => {
beforeEach(() => {
cy.awaitUrl("/", true);
Expand Down
4 changes: 0 additions & 4 deletions cypress/e2e/auth_spec/auth.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/// <reference types="cypress" />

import { cy, describe, beforeEach, it } from "local-cypress";

describe("Authorisation/Authentication", () => {
beforeEach(() => {
cy.awaitUrl("/", true);
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/auth_spec/redirect.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cy, describe, it, beforeEach, Cypress } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("redirect", () => {
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/auth_spec/roles.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { afterEach, cy, describe, it } from "local-cypress";
import * as users from "../../fixtures/users.json";

describe("authentication", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";

describe("External Results Filters", () => {
before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
import {
cy,
describe,
it,
before,
beforeEach,
afterEach,
expect,
} from "local-cypress";

describe("Edit Profile Testing", () => {
before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
Expand Down Expand Up @@ -43,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 All @@ -52,7 +44,7 @@ describe("Edit Profile Testing", () => {
});

it("export", () => {
cy.intercept("**", (req: Cypress.Request) => {
cy.intercept("**", (req) => {
const url = new URL(req.url);
const params = new URLSearchParams(url.search);
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// FacilityCreation
import {
cy,
describe,
before,
beforeEach,
it,
afterEach,
expect,
} from "local-cypress";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// FacilityCreation
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";

import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import ManageUserPage from "../../pageobject/Users/ManageUserPage";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
Expand Down Expand Up @@ -92,7 +91,7 @@ describe("Location Management Section", () => {
facilityLocation.selectBedType(bedType);
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Name - Bed with same name already exists in location"
"Name - Bed with same name already exists in location",
);
facilityHome.verifyAndCloseNotifyModal();
// edit the created bed
Expand Down Expand Up @@ -185,7 +184,7 @@ describe("Location Management Section", () => {
facilityLocation.deleteLocation("Test Location");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Location Test Location deleted successfully"
"Location Test Location deleted successfully",
);
facilityLocation.closeNotification();
});
Expand All @@ -204,7 +203,7 @@ describe("Location Management Section", () => {
facilityLocation.deleteLocation("Test Location with Beds");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Cannot delete a Location with associated Beds"
"Cannot delete a Location with associated Beds",
);
facilityLocation.closeNotification();

Expand All @@ -219,7 +218,7 @@ describe("Location Management Section", () => {
facilityLocation.deleteLocation("Test Location with Beds");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Location Test Location with Beds deleted successfully"
"Location Test Location with Beds deleted successfully",
);
facilityLocation.closeNotification();
});
Expand Down Expand Up @@ -249,14 +248,14 @@ describe("Location Management Section", () => {
"Vendor's Name",
serialNumber,
"25122021",
"Test note for asset creation!"
"Test note for asset creation!",
);
assetPage.clickassetupdatebutton();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
facilityLocation.deleteLocation("Test Location with linked Assets");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Cannot delete a Location with associated Assets"
"Cannot delete a Location with associated Assets",
);
facilityLocation.closeNotification();

Expand All @@ -271,7 +270,7 @@ describe("Location Management Section", () => {
facilityLocation.deleteLocation("Test Location with linked Assets");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Location Test Location with linked Assets deleted successfully"
"Location Test Location with linked Assets deleted successfully",
);
facilityLocation.closeNotification();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import FacilityManage from "../../pageobject/Facility/FacilityManage";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
Expand Down Expand Up @@ -45,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
@@ -1,4 +1,3 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientDischarge from "../../pageobject/Patient/PatientDischarge";
Expand Down
61 changes: 61 additions & 0 deletions cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import { PatientDoctorNotes } from "../../pageobject/Patient/PatientDoctorNotes";

describe("Patient Discussion notes in the consultation page", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientDoctorNotes = new PatientDoctorNotes();
const patientName = "Dummy Patient 4";
const patientNurseNote = "Test nurse Notes";
const patientNurseReplyNote = "Test nurse reply Notes";
const discussionNotesSubscribeWarning =
"Please subscribe to notifications to get live updates on discussion notes.";
const discussionNotesSuccessMessage = "Note added successfully";

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

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

it("Create a nurse note for a patient and verify both ID received the messages", () => {
// Create a doctor notes a with a district admin
patientPage.visitPatient(patientName);
patientDoctorNotes.visitDiscussionNotesPage();
cy.verifyNotification(discussionNotesSubscribeWarning);
cy.closeNotification();
// switch the switch to nurse note, as the bydefault is doctornotes
patientDoctorNotes.selectNurseDiscussion();
patientDoctorNotes.addDiscussionNotes(patientNurseNote);
patientDoctorNotes.postDiscussionNotes();
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
// verify the auto-switching of tab to nurse notes if the user is a nurse
cy.get("p").contains("Sign Out").click();
loginPage.loginManuallyAsNurse();
loginPage.ensureLoggedIn();
cy.visit("/patients");
patientPage.visitPatient(patientName);
patientDoctorNotes.visitDiscussionNotesPage();
// verify the message is received from admin
cy.verifyNotification(discussionNotesSubscribeWarning);
cy.closeNotification();
patientDoctorNotes.verifyDiscussionMessage(patientNurseNote);
// Post a reply comment to the message
patientDoctorNotes.addDiscussionNotes(patientNurseReplyNote);
patientDoctorNotes.postDiscussionNotes();
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
patientDoctorNotes.verifyDiscussionMessage(patientNurseReplyNote);
});

afterEach(() => {
cy.saveLocalStorage();
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import { PatientFileUpload } from "../../pageobject/Patient/PatientFileupload";
Expand Down
Loading

0 comments on commit b81047e

Please sign in to comment.