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

Production Release January Week 1 #6969

Merged
merged 20 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6b1ebc6
Add keyboard shortcut for adding notes (#6915)
GokulramGHV Dec 28, 2023
71fbb5e
Rename encounter date field labels (#6914)
rithviknishad Dec 28, 2023
72f5285
Support for self-healing Consultation URL (#6893)
konavivekramakrishna Dec 28, 2023
95353a4
Timeline style view for Daily Rounds (#6808)
Pranshu1902 Dec 28, 2023
4a65698
facility pagination and redirection (#6912)
nihal467 Dec 28, 2023
283504d
Replace all window.location.reload() with data refetch. (#6892)
sriharsh05 Dec 28, 2023
3c008b2
Replaced useDipatch with useQuery/request in FacilityCreate and Hospi…
sriharsh05 Dec 28, 2023
cfe0011
Refactor middleware hostname usage in CameraFeed components (#6875)
Ashesh3 Dec 28, 2023
988e383
Fix mispositioned active link indicator (#6880)
Omkar76 Dec 28, 2023
8a9234f
Migrate Bed Management to `useQuery` and move pagination state to que…
rithviknishad Dec 28, 2023
36fa6e3
Fix latitude and longitude handling in FacilityCreate component (#6934)
Ashesh3 Dec 28, 2023
4a49768
Add OP number to treatment summary. (#6898)
AshrafMd-1 Dec 28, 2023
22f36fd
Add consciousness level options for normal daily round type (#6935)
Ashesh3 Dec 28, 2023
8197f29
Fix empty state in LocationManagement and BedManagement (#6937)
Ashesh3 Dec 29, 2023
096905d
fixes not found errors in investigation and other type errors (#6948)
rithviknishad Dec 29, 2023
06a2afd
Update consciousness level constants (#6947)
Ashesh3 Dec 29, 2023
1085e0f
fix resp. rate from being 0 instead of null when unset (#6949)
rithviknishad Dec 29, 2023
8aea0cc
fix has previous log update not being filled (#6951)
rithviknishad Dec 30, 2023
c5c86aa
fix daily rounds vital fields not clearing (#6954)
rithviknishad Dec 30, 2023
f066a36
Fix conditional logic in PatientInfoCard (#6955)
Ashesh3 Dec 30, 2023
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
35 changes: 33 additions & 2 deletions cypress/e2e/facility_spec/facility_homepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ import FacilityHome from "../../pageobject/Facility/FacilityHome";
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 facilityPage = new FacilityPage();
const manageUserPage = new ManageUserPage();
const userPage = new UserPage();
const assetPagination = new AssetPagination();
const facilitiesAlias = "downloadFacilitiesCSV";
const capacitiesAlias = "downloadCapacitiesCSV";
const doctorsAlias = "downloadDoctorsCSV";
const triagesAlias = "downloadTriagesCSV";
const facilityname = "Dummy Facility 1";
const statename = "Kerala";
const district = "Ernakulam";
const localbody = "Aikaranad";
const facilitytype = "Private Hospital";

before(() => {
Expand All @@ -31,24 +34,52 @@ describe("Facility Homepage Function", () => {
cy.awaitUrl("/facility");
});

it("Verify the Facility card button redirection", () => {
// view cns button
facilityHome.clickViewCnsButton();
facilityHome.verifyCnsUrl();
facilityHome.navigateBack();
// view notify button
facilityHome.clickFacilityNotifyButton();
facilityHome.verifyAndCloseNotifyModal();
// view facility button
facilityHome.clickViewFacilityDetails();
facilityPage.getFacilityName().should("be.visible");
facilityHome.verifyFacilityDetailsUrl();
facilityHome.navigateBack();
// view patient button
manageUserPage.clickFacilityPatients();
facilityHome.verifyPatientListVisibility();
facilityHome.verifyPatientListUrl();
facilityHome.navigateBack();
// occupancy badge
facilityHome.verifyOccupancyBadgeVisibility();
});

it("Verify the functionality of advance filter", () => {
userPage.clickAdvancedFilters();
facilityPage.selectState(statename);
facilityPage.selectDistrict(district);
// facilityPage.selectLocalBody("Anthikad Grama"); current dummy data have issue in local body
facilityPage.selectLocalBody(localbody);
facilityPage.clickUpdateFacilityType(facilitytype);
userPage.applyFilter();
facilityPage.verifyStateBadgeContent(statename);
facilityPage.verifyDistrictBadgeContent(district);
facilityPage.verifyLocalBodyBadgeContent(localbody);
facilityPage.verifyFacilityTypeBadgeContent(facilitytype);
manageUserPage.assertFacilityInCard(facilityname);
userPage.clearFilters();
userPage.verifyDataTestIdNotVisible("State");
userPage.verifyDataTestIdNotVisible("District");
userPage.verifyDataTestIdNotVisible("Facility type");
userPage.verifyDataTestIdNotVisible("Local Body");
});

it("Search a facility in homepage", () => {
it("Search a facility in homepage and pagination", () => {
// pagination of the facility page
assetPagination.navigateToNextPage();
assetPagination.navigateToPreviousPage();
// search for a facility
manageUserPage.typeFacilitySearch(facilityname);
facilityPage.verifyFacilityBadgeContent(facilityname);
manageUserPage.assertFacilityInCard(facilityname);
Expand Down
89 changes: 51 additions & 38 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ 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 { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import FacilityHome from "../../pageobject/Facility/FacilityHome";


describe("Location Management Section", () => {
const assetPage = new AssetPage();
const userCreationPage = new UserCreationPage();
const facilityPage = new FacilityPage();
const facilityLocation = new FacilityLocation();
// const assetPagination = new AssetPagination();
const assetPagination = new AssetPagination();
const facilityHome = new FacilityHome();

const EXPECTED_LOCATION_ERROR_MESSAGES = [
"Name is required",
"Location Type is required",
Expand All @@ -27,15 +31,15 @@ describe("Location Management Section", () => {
const locationModifiedDescription = "Test Modified Description";
const locationModifiedType = "ICU";
const locationModifiedMiddleware = "dev-middleware.coronasafe.live";
const bedName = "Test Bed";
const bedName = "Test-Bed";
const bedDescrption = "test description";
const bedType = "ICU";
const bedStatus = "Vacant";
const bedModifiedName = "test modified bed";
const bedModifiedDescrption = "test modified description";
const bedModifiedType = "Isolation";
const numberOfBeds = 10;
// const numberOfModifiedBeds = 25;
const numberOfModifiedBeds = 25;

before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
Expand All @@ -56,6 +60,42 @@ describe("Location Management Section", () => {
cy.get("[id=location-management]").click();
});

it("Add a Bed to facility location along with duplication and deleting a bed", () => {
// mandatory field verification in bed creation
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
assetPage.clickassetupdatebutton();
userCreationPage.verifyErrorMessages(EXPECTED_BED_ERROR_MESSAGES);
// create a new single bed and verify
facilityLocation.enterBedName(bedName);
facilityLocation.enterBedDescription(bedDescrption);
facilityLocation.selectBedType(bedType);
assetPage.clickassetupdatebutton();
// Verify the bed creation
facilityLocation.verifyBedNameBadge(bedName);
facilityLocation.verifyBedBadge(bedType);
facilityLocation.verifyBedBadge(bedStatus);
// Try to create duplication bed and verify the error
facilityLocation.clickAddBedButton();
facilityLocation.enterBedName(bedName);
facilityLocation.selectBedType(bedType);
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Name - Bed with same name already exists in location"
);
facilityHome.verifyAndCloseNotifyModal();
// edit the created bed
facilityLocation.clickEditBedButton();
facilityLocation.enterBedName(bedModifiedName);
facilityLocation.enterBedDescription(bedModifiedDescrption);
facilityLocation.selectBedType(bedModifiedType);
assetPage.clickassetupdatebutton();
// verify the modification
facilityLocation.verifyBedNameBadge(bedModifiedName);
facilityLocation.verifyBedBadge(bedModifiedType);
facilityLocation.verifyBedBadge(bedStatus);
});

it("Adds Location to a facility and modify it", () => {
// add a new location form mandatory error
facilityLocation.clickAddNewLocationButton();
Expand Down Expand Up @@ -86,7 +126,7 @@ describe("Location Management Section", () => {
facilityLocation.verifyLocationMiddleware(locationModifiedMiddleware);
});

it("Add Multiple Bed to a facility location and delete a bed", () => {
it("Multiple Bed to a facility location and delete a bed", () => {
// create multiple bed and verify
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
Expand All @@ -106,45 +146,18 @@ describe("Location Management Section", () => {
facilityLocation.deleteBedRequest();
});

// it("Add Multiple Bed to a facility location and verify pagination", () => {
// // bed creation
// facilityLocation.clickManageBedButton();
// facilityLocation.clickAddBedButton();
// facilityLocation.enterBedName(bedModifiedName);
// facilityLocation.enterBedDescription(bedModifiedDescrption);
// facilityLocation.selectBedType(bedModifiedType);
// facilityLocation.setMultipleBeds(numberOfModifiedBeds);
// assetPage.clickassetupdatebutton();
// // pagination
// assetPagination.navigateToNextPage();
// assetPagination.navigateToPreviousPage();
// }); need to be unblocked upon issue #6906 is solved

it("Add Single Bed to a facility location and modify it", () => {
// mandatory field verification in bed creation
it("Add Multiple Bed to a facility location and verify pagination", () => {
// bed creation
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
assetPage.clickassetupdatebutton();
userCreationPage.verifyErrorMessages(EXPECTED_BED_ERROR_MESSAGES);
// create a new single bed and verify
facilityLocation.enterBedName(bedName);
facilityLocation.enterBedDescription(bedDescrption);
facilityLocation.selectBedType(bedType);
assetPage.clickassetupdatebutton();
// Verify the bed creation
facilityLocation.verifyBedNameBadge(bedName);
facilityLocation.verifyBedBadge(bedType);
facilityLocation.verifyBedBadge(bedStatus);
// edit the created bed
facilityLocation.clickEditBedButton();
facilityLocation.enterBedName(bedModifiedName);
facilityLocation.enterBedDescription(bedModifiedDescrption);
facilityLocation.selectBedType(bedModifiedType);
facilityLocation.setMultipleBeds(numberOfModifiedBeds);
assetPage.clickassetupdatebutton();
// verify the modification
facilityLocation.verifyBedNameBadge(bedModifiedName);
facilityLocation.verifyBedBadge(bedModifiedType);
facilityLocation.verifyBedBadge(bedStatus);
// pagination
assetPagination.navigateToNextPage();
assetPagination.navigateToPreviousPage();
});

afterEach(() => {
Expand Down
7 changes: 7 additions & 0 deletions cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class FacilityPage {
cy.intercept("https://maps.googleapis.com/maps/api/mapsjs/*").as("mapApi");
cy.wait("@mapApi").its("response.statusCode").should("eq", 200);
cy.get("input#pac-input").type(location).type("{enter}");
cy.wait(2000);
cy.get("div#map-close").click();
}

Expand Down Expand Up @@ -337,6 +338,10 @@ class FacilityPage {
cy.get("[data-testid='District']").should("contain", expectedText);
}

verifyLocalBodyBadgeContent(expectedText: string) {
cy.get("[data-testid='Local Body']").should("contain", expectedText);
}

verifyFacilityTypeBadgeContent(expectedText: string) {
cy.get("[data-testid='Facility type']").should("contain", expectedText);
}
Expand Down Expand Up @@ -414,6 +419,7 @@ class FacilityPage {
selectStateOnPincode(stateName) {
this.getStateElement()
.scrollIntoView()
.wait(2000)
.should("be.visible")
.then(($element) => {
const text = $element.text();
Expand All @@ -427,6 +433,7 @@ class FacilityPage {
selectDistrictOnPincode(districtName) {
this.getDistrictElement()
.scrollIntoView()
.wait(2000)
.should("be.visible")
.then(($element) => {
const text = $element.text();
Expand Down
43 changes: 43 additions & 0 deletions cypress/pageobject/Facility/FacilityHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,49 @@ class FacilityHome {
cy.intercept("GET", `**/api/v1/facility/?csv${queryParam}`).as(alias);
}

clickViewCnsButton() {
cy.get("#view-cns-button").first().click();
}

verifyCnsUrl() {
cy.url().should("include", "/cns");
}

clickFacilityNotifyButton() {
cy.get("#facility-notify").first().click();
}

verifyFacilityDetailsUrl() {
cy.url().should("match", /\/facility\/[\w-]+/);
}

verifyPatientListVisibility() {
cy.get("#patient-name-list").scrollIntoView();
cy.get("#patient-name-list").should("be.visible");
}

verifyPatientListUrl() {
cy.url().should("match", /\/patients\?facility=.+/);
}

verifyOccupancyBadgeVisibility() {
cy.get("#occupany-badge").should("be.visible");
}

verifyAndCloseNotifyModal() {
cy.get("#cancel").should("be.visible");
cy.get("#cancel").click();
}

navigateBack() {
cy.go(-1);
}

clickViewFacilityDetails() {
cy.get("#facility-details").should("be.visible");
cy.get("#facility-details").first().click();
}

verifyDownload(alias: string) {
cy.wait(`@${alias}`).its("response.statusCode").should("eq", 200);
}
Expand Down
6 changes: 5 additions & 1 deletion cypress/pageobject/Facility/FacilityLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class FacilityLocation {
cy.get("#location-type").contains(type);
}

verifyNotification(message: string) {
cy.get(".pnotify-container").should("contain", message).and("be.visible");
}

verifyLocationDescription(description: string) {
cy.get("#view-location-description").contains(description);
}
Expand All @@ -49,7 +53,7 @@ class FacilityLocation {
}

enterBedName(name: string) {
cy.get("#bed-name").clear().click().type(name);
cy.get("#bed-name").click().clear().click().type(name);
}

enterBedDescription(description: string) {
Expand Down
1 change: 1 addition & 0 deletions cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class ManageUserPage {
}

clickFacilityPatients() {
cy.get("#facility-patients").should("be.visible");
cy.get("#facility-patients").click();
}

Expand Down
6 changes: 4 additions & 2 deletions src/CAREUI/display/RecordMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import CareIcon from "../icons/CareIcon";
import {
formatDateTime,
formatDate,
formatName,
formatTime,
isUserOnline,
relativeTime,
} from "../../Utils/utils";
Expand Down Expand Up @@ -38,7 +39,8 @@ const RecordMeta = ({
<div className="tooltip">
<span className="underline">{relativeTime(time)}</span>
<span className="tooltip-text tooltip-bottom flex -translate-x-1/2 gap-1 text-xs font-medium tracking-wider">
{formatDateTime(time)}
{formatTime(time)} <br />
{formatDate(time)}
{user && !inlineUser && (
<span className="flex items-center gap-1">
by
Expand Down
Loading
Loading