Skip to content

Commit

Permalink
Merge branch 'develop' into fix_loading
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijv256 authored Jan 23, 2024
2 parents 15d13ab + 8025200 commit 4c6cbcc
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 31 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/assets_spec/asset_homepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ describe("Asset Tab", () => {

it("Filter Asset", () => {
assetFilters.filterAssets(
"Dummy Facility 1",
"Dummy Facility 40",
"INTERNAL",
"ACTIVE",
"ONVIF Camera",
"Camera Loc"
);
assetFilters.clickadvancefilter();
assetFilters.clickslideoverbackbutton(); // to verify the back button doesn't clear applied filters
assetFilters.assertFacilityText("Dummy Facility 1");
assetFilters.assertFacilityText("Dummy Facility 40");
assetFilters.assertAssetTypeText("INTERNAL");
assetFilters.assertAssetClassText("ONVIF");
assetFilters.assertStatusText("ACTIVE");
Expand All @@ -89,7 +89,7 @@ describe("Asset Tab", () => {
it("Import new asset", () => {
assetPage.selectassetimportbutton();
assetPage.selectImportOption();
assetPage.selectImportFacility("Dummy Facility 1");
assetPage.selectImportFacility("Dummy Facility 40");
assetPage.importAssetFile();
assetPage.selectImportLocation("Camera Loc");
assetPage.clickImportAsset();
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/assets_spec/assets_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("Asset", () => {

it("Verify asset creation fields throws error if empty", () => {
assetPage.createAsset();
assetPage.selectFacility("Dummy Facility 1");
assetPage.selectFacility("Dummy Facility 40");
assetPage.clickCreateAsset();

assetPage.verifyEmptyAssetNameError();
Expand All @@ -39,7 +39,7 @@ describe("Asset", () => {

it("Create an Asset", () => {
assetPage.createAsset();
assetPage.selectFacility("Dummy Facility 1");
assetPage.selectFacility("Dummy Facility 40");
assetPage.selectLocation("Camera Loc");
assetPage.selectAssetType("Internal");
assetPage.selectAssetClass("ONVIF Camera");
Expand Down Expand Up @@ -139,7 +139,7 @@ describe("Asset", () => {

it("Add an vital monitor asset and configure it", () => {
assetPage.createAsset();
assetPage.selectFacility("Dummy Facility 1");
assetPage.selectFacility("Dummy Facility 40");
assetPage.selectLocation("Camera Loc");
assetPage.selectAssetType("Internal");
assetPage.selectAssetClass("HL7 Vitals Monitor");
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/assets_spec/assets_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("Asset", () => {
const facilityPage = new FacilityPage();
const assetSearchPage = new AssetSearchPage();
const assetFilters = new AssetFilters();
const fillFacilityName = "Dummy Facility 1";
const fillFacilityName = "Dummy Facility 40";
const assetname = "Dummy Camera";
const locationName = "Dummy Location 1";
const initiallocationName = "Camera Location";
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("Facility Creation", () => {
const doctorCapacity = "5";
const totalDoctor = "10";
const facilityName = "cypress facility";
const facilityName2 = "Dummy Facility 1";
const facilityName2 = "Dummy Facility 40";
const facilityAddress = "cypress address";
const facilityUpdateAddress = "cypress updated address";
const facilityNumber = "9898469865";
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/facility_homepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Facility Homepage Function", () => {
const capacitiesAlias = "downloadCapacitiesCSV";
const doctorsAlias = "downloadDoctorsCSV";
const triagesAlias = "downloadTriagesCSV";
const facilityName = "Dummy Facility 1";
const facilityName = "Dummy Facility 40";
const facilityLocaion = "Dummy Location";
const stateName = "Kerala";
const district = "Ernakulam";
Expand Down
22 changes: 19 additions & 3 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("Location Management Section", () => {
"Please select a bed type",
];
const locationName = "Test-location";
const locationNameTwo = "Test-location-2";
const locationDescription = "Test Description";
const locationType = "WARD";
const locationMiddleware = "dev_middleware.coronasafe.live";
Expand Down Expand Up @@ -57,7 +58,20 @@ describe("Location Management Section", () => {

it("Add a Bed to facility location along with duplication and deleting a bed", () => {
// mandatory field verification in bed creation
facilityLocation.clickManageBedButton();
cy.get("body").then(($body) => {
if ($body.find("#manage-bed-button:visible").length) {
// If the '#manage-bed-button' is visible
facilityLocation.clickManageBedButton();
} else {
// If the '#manage-bed-button' is not visible
facilityLocation.clickAddNewLocationButton();
facilityPage.fillFacilityName(locationName);
facilityLocation.selectLocationType(locationType);
assetPage.clickassetupdatebutton();
facilityLocation.clickNotification();
facilityLocation.clickManageBedButton();
}
});
facilityLocation.clickAddBedButton();
assetPage.clickassetupdatebutton();
userCreationPage.verifyErrorMessages(EXPECTED_BED_ERROR_MESSAGES);
Expand Down Expand Up @@ -97,13 +111,14 @@ describe("Location Management Section", () => {
assetPage.clickassetupdatebutton();
userCreationPage.verifyErrorMessages(EXPECTED_LOCATION_ERROR_MESSAGES);
// create a new location
facilityPage.fillFacilityName(locationName);
facilityPage.fillFacilityName(locationNameTwo);
facilityLocation.fillDescription(locationDescription);
facilityLocation.selectLocationType(locationType);
facilityLocation.fillMiddlewareAddress(locationMiddleware);
assetPage.clickassetupdatebutton();
facilityLocation.clickNotification();
// verify the reflection
facilityLocation.verifyLocationName(locationName);
facilityLocation.verifyLocationName(locationNameTwo);
facilityLocation.verifyLocationType(locationType);
facilityLocation.verifyLocationDescription(locationDescription);
facilityLocation.verifyLocationMiddleware(locationMiddleware);
Expand All @@ -130,6 +145,7 @@ describe("Location Management Section", () => {
facilityLocation.selectBedType(bedType);
facilityLocation.setMultipleBeds(numberOfBeds);
assetPage.clickassetupdatebutton();
facilityLocation.clickNotification();
// verify the bed creation
facilityLocation.verifyBedBadge(bedType);
facilityLocation.verifyBedBadge(bedStatus);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/patient_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("Patient Creation with consultation", () => {

it("Create a new patient with no consultation", () => {
patientPage.createPatient();
patientPage.selectFacility("dummy facility");
patientPage.selectFacility("dummy facility 40");
patientPage.patientformvisibility();
patientPage.enterPatientDetails(
phone_number,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/resource_spec/filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("Resource filter", () => {
cy.intercept(/\/api\/v1\/getallfacilities/).as("facilities_filter");
cy.contains("Filters").click();
cy.get("[name='origin_facility']")
.type("Dummy Facility 1")
.type("Dummy Facility 40")
.wait("@facilities_filter");
cy.get("[role='option']").first().click();
cy.contains("Apply").click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/resource_spec/resources.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Resource Page", () => {

it("Create a resource request", () => {
cy.visit("/facility");
cy.get("#search").click().type("dummy facility 1");
cy.get("#search").click().type("dummy facility 40");
cy.intercept("GET", "**/api/v1/facility/**").as("loadFacilities");
cy.get("#facility-details").click();
cy.wait("@loadFacilities").its("response.statusCode").should("eq", 200);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/user_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("User Creation", () => {
const userCreationPage = new UserCreationPage();
const facilityPage = new FacilityPage();
const assetSearchPage = new AssetSearchPage();
const fillFacilityName = "Dummy Facility 1";
const fillFacilityName = "Dummy Facility 40";
const makeid = (length: number) => {
let result = "";
const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/user_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("Manage User", () => {
const usernameforworkinghour = "devdistrictadmin";
const usernamerealname = "Dummy Doctor";
const facilitytolinkusername = "Dummy Shifting Center";
const facilitytolinkskill = "Dummy Facility 1";
const facilitytolinkskill = "Dummy Facility 40";
const workinghour = "23";
const linkedskill = "General Medicine";

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/users_spec/user_profile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("Manage User Profile", () => {
const doctorYoE = "10";
const medicalCouncilRegistration = "1234567890";

const facilitySearch = "Dummy Facility 1";
const facilitySearch = "Dummy Facility 40";

before(() => {
loginPage.loginAsDevDoctor();
Expand Down
2 changes: 0 additions & 2 deletions cypress/pageobject/Asset/AssetFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export class AssetFilters {
});
}
clickadvancefilter() {
cy.intercept("GET", "**/api/v1/getallfacilities/**").as("advancefilter");
cy.get("#advanced-filter").click();
cy.wait("@advancefilter").its("response.statusCode").should("eq", 200);
}
clickslideoverbackbutton() {
cy.get("#close-slide-over").click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FacilityPage {
}

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

fillPincode(pincode: string) {
Expand Down
4 changes: 4 additions & 0 deletions cypress/pageobject/Facility/FacilityLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class FacilityLocation {
cy.get("#add-new-bed").click();
}

clickNotification() {
cy.get(".pnotify").click();
}

enterBedName(name: string) {
cy.get("#bed-name").click().clear().click().type(name);
}
Expand Down
3 changes: 1 addition & 2 deletions public/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"dashboard_url": "https://dashboard.coronasafe.in",
"github_url": "https://github.com/coronasafe",
"coronasafe_url": "https://coronasafe.network?ref=care",
"site_url": "care.coronasafe.in",
Expand All @@ -23,4 +22,4 @@
"sample_format_asset_import": "https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=11JaEhNHdyCHth4YQs_44YaRlP77Rrqe81VSEfg1glko&exportFormat=xlsx",
"sample_format_external_result_import": "/External-Results-Template.csv",
"enable_abdm": true
}
}
2 changes: 1 addition & 1 deletion src/Common/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ILogo {
}

export interface IConfig {
dashboard_url: string;
dashboard_url?: string;
github_url: string;
coronasafe_url: string;
site_url: string;
Expand Down
16 changes: 9 additions & 7 deletions src/Components/Common/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ const StatelessSidebar = ({
handleOverflow={handleOverflow}
onClickCB={() => onItemClick && onItemClick(false)}
/>
<Item
text="Dashboard"
to={dashboard_url}
icon={<CareIcon className="care-l-dashboard text-lg" />}
external
handleOverflow={handleOverflow}
/>
{dashboard_url && (
<Item
text="Dashboard"
to={dashboard_url}
icon={<CareIcon className="care-l-dashboard text-lg" />}
external
handleOverflow={handleOverflow}
/>
)}
</div>
<div className="hidden md:block md:flex-1" />

Expand Down

0 comments on commit 4c6cbcc

Please sign in to comment.