Skip to content

Commit

Permalink
Merge branch 'develop' into issues/3924/support-for-profile-pic
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Sep 24, 2024
2 parents 167c2fa + 214b373 commit d9f7b69
Show file tree
Hide file tree
Showing 77 changed files with 1,597 additions and 1,228 deletions.
1 change: 1 addition & 0 deletions .github/runner-files/jwks.b64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJrZXlzIjogW3sibiI6ICJ4X21fNGNKQ3NHTHN4WkFIa2VCbFZQa2ZqNFNSckdHN3UySERFM3VLX3dFNERhTWhHQ2lxTXFsaTFDM2pxSE5JTVhuWV9ab1M5R3pHbnJpdGg1UUZGVDlLMGtBdF9YaXBJNnV1djcwOWtOV2FFNXZrYks4VlFRcFd2UFp4NUJSeTBGay0wU2lxZG1xOTNJRXdUTnNTLUpETnRXQm5VX0F1cjU0UXptQmI3SmhfOGttRDAtaHhROVZVejRpSUU3QTlySU5vQXNHSHhfdGtuNXd6YmpPR3F2Q3JqRi1RWXo0OGJXVkZzVVliNkFqUlFrZER2RWVwQlpNSHZsNVUxQlZxOVdRTTJGTmRUR0tJb3ZYeDRuTDFybUVONHpxbEpqWmc2bEZiODVuOUhkc01VblFiSXhkUjVlVl8wWmNVaHBrQWc0NldrejRZWkxMNm5NaGR0RmFTMXciLCAiZSI6ICJBUUFCIiwgImQiOiAiRXo4T3dDZ2xxZnREWlhwSXVEbjhGck1KWGhNNHZfb0NDdlZNUko1QjBPd3BuR3BrWDRKZWF4VFJYYkZ5OVQzdkowX2VXZjRQcl9XZUloMk5HZnpkaGw5NmtJUzd5R2JxQkhSY0U3a2ZhVWFkbHlDTVdnZDV5TEk1aWVOQUw5N2w4X1o2N0w5NHRIX3VlUF80Q1pXV0hGVTNieXJ4bHVzSld6NmZ5SFVPczlVSDFxV284V1RNOVp0RndqV0cxOWpkUXZ1RkQ0Z0x4UEJYZEk5ZV9zdTNwbmZHR0ZkN0xfMDFwcEFkQ2Y5eHhNTWFEel8wZ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RwOTg4TXJTUThHZGdLU3pMd2dCWTdEeUE3MkR2UG9CUHQtODgiLCAicWkiOiAiSlF0UUJERXdnQVVMcWJFRWoybmdyXy02aV9pUmdRWmJTQ0hXNGdpZG5fdHlwdUJWS2R0ZW1jT3J6M3NnTnk0ekZrZElTbUZfbmdnbFlJb080TjNza1NNUXdGY1B0S1kzWUVlT2ZGNzMzRDZaTVJtSTFTby12QU54YVBDUkREbnUwTWk1TnUzbS02SkhGSFF5RDU2ZTFsQUlwUS1lakpuTWR6MXQ0aUplbEFzIiwgImt0eSI6ICJSU0EiLCAia2lkIjogIlhjckcyVS0tR3B4SVhORXpKOWNWREdRaEUzeXlIamREMDN1aDZmYXpRX2siLCAiYWxnIjogIlJTMjU2In1dfQ==
3 changes: 3 additions & 0 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ jobs:
cd care
echo DISABLE_RATELIMIT=True >> docker/.prebuilt.env
echo "CORS_ALLOWED_ORIGINS=\"[\\\"http://localhost:4000\\\"]\"" >> docker/.prebuilt.env
echo JWKS_BASE64=\"$(cat ../.github/runner-files/jwks.b64.txt)\" >> docker/.prebuilt.env
make docker_config_file=docker-compose.pre-built.yaml up
make docker_config_file=docker-compose.pre-built.yaml load-dummy-data
cd ..
env:
JWKS_BASE64: ${{ secrets.JWKS_BASE64 }}

- name: Wait for care to be up ♻
uses: nick-fields/retry@v2
Expand Down
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export default defineConfig({
},
env: {
API_URL: process.env.REACT_CARE_API_URL ?? "http://localhost:9000",
ENABLE_HCX: process.env.REACT_ENABLE_HCX ?? false,
},
});
1 change: 1 addition & 0 deletions cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe("Asset Tab", () => {

it("Export asset", () => {
assetPage.selectassetimportbutton();
cy.wait(2000);
assetPage.selectjsonexportbutton();
assetPage.selectassetimportbutton();
assetPage.selectcsvexportbutton();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe("Facility Creation", () => {
facilityPage.submitForm();
cy.closeNotification();
// create multiple bed capacity and verify card reflection
facilityPage.selectBedType("Oxygen beds");
facilityPage.selectBedType("Oxygen Supported Bed");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
Expand Down Expand Up @@ -216,7 +216,7 @@ describe("Facility Creation", () => {
facilityPage.fillPhoneNumber(facilityNumber);
facilityPage.submitForm();
// add the bed capacity
facilityPage.selectBedType("Oxygen beds");
facilityPage.selectBedType("Oxygen Supported Bed");
facilityPage.fillTotalCapacity(oxygenCapacity);
facilityPage.fillCurrentlyOccupied(oxygenExpected);
facilityPage.saveAndExitBedCapacityForm();
Expand Down
21 changes: 8 additions & 13 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe("Facility Homepage Function", () => {
const userPage = new UserPage();
const assetPagination = new AssetPagination();
const facilitiesAlias = "downloadFacilitiesCSV";
const capacitiesAlias = "downloadCapacitiesCSV";
const doctorsAlias = "downloadDoctorsCSV";
const triagesAlias = "downloadTriagesCSV";
const facilityName = "Dummy Facility 40";
Expand Down Expand Up @@ -91,30 +90,26 @@ describe("Facility Homepage Function", () => {
});

it("Verify Facility Export Functionality", () => {
// Download the Facilities CSV
// Verify Facility Export
facilityHome.csvDownloadIntercept(facilitiesAlias, "");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Facilities");
facilityHome.verifyDownload(facilitiesAlias);
facilityHome.clickSearchButton(); // to avoid flaky test, as sometimes, the test is unable to focus on the object
// Download the Capacities CSV
facilityHome.csvDownloadIntercept(capacitiesAlias, "&capacity");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Capacities");
facilityHome.verifyDownload(capacitiesAlias);
facilityHome.clickSearchButton();
// Download the Doctors CSV
// Verify Doctor Export
facilityHome.csvDownloadIntercept(doctorsAlias, "&doctors");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Doctors");
facilityHome.verifyDownload(doctorsAlias);
facilityHome.clickSearchButton();
// Download the Triages CSV
// Verify Triage Export
facilityHome.csvDownloadIntercept(triagesAlias, "&triage");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Triages");
facilityHome.verifyDownload(triagesAlias);
facilityHome.clickSearchButton();
});

it("Verify Capacity Export Functionality", () => {
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Capacities");
});

it("Verify Facility Detail page redirection to CNS and Live Minitoring ", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe("Facility Manage Functions", () => {
it("Modify bed capacity in Facility detail page", () => {
// add multiple new bed capacity
facilityManage.clickFacilityAddBedTypeButton();
facilityPage.selectBedType("Oxygen beds");
facilityPage.selectBedType("Isolation Bed");
facilityPage.fillTotalCapacity(totalCapacity);
facilityPage.fillCurrentlyOccupied(currentOccupied);
facilityPage.saveAndExitBedCapacityForm();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const additionalSymptoms = "Fever";
const physicalExamination = "physical examination details";
const otherExamination = "Other";
const patientSystolic = "119";
const patientDiastolic = "150";
const patientModifiedSystolic = "120";
const patientModifiedDiastolic = "145";
const patientSystolic = "149";
const patientDiastolic = "119";
const patientModifiedSystolic = "145";
const patientModifiedDiastolic = "120";
const patientPulse = "152";
const patientTemperature = "96.6";
const patientRespiratory = "140";
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/PatientPrescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ describe("Patient Medicine Administration", () => {
cy.closeNotification();
// Administer the medicine in edit form
patientPrescription.clickAdministerButton();
cy.wait(2000);
patientPrescription.enterAdministerDosage(medicineBaseDosage);
patientPrescription.enterAdministerNotes(medicineAdministerNote);
cy.submitButton("Administer Medicine");
Expand Down
55 changes: 35 additions & 20 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PatientInsurance from "../../pageobject/Patient/PatientInsurance";
import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory";

const yearOfBirth = "2001";
const isHCXEnabled = Cypress.env("ENABLE_HCX");

const calculateAge = () => {
const currentYear = new Date().getFullYear();
Expand Down Expand Up @@ -180,16 +181,21 @@ describe("Patient Creation with consultation", () => {
"policy_id",
patientOneFirstPolicyId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_id",
patientOneFirstInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_name",
patientOneFirstInsurerName,
);
if (isHCXEnabled) {
patientInsurance.selectInsurer("test");
} else {
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_id",
patientOneFirstInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_name",
patientOneFirstInsurerName,
);
}

patientInsurance.clickAddInsruanceDetails();
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
Expand All @@ -201,16 +207,21 @@ describe("Patient Creation with consultation", () => {
"policy_id",
patientOneSecondPolicyId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_id",
patientOneSecondInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_name",
patientOneSecondInsurerName,
);
if (isHCXEnabled) {
patientInsurance.selectInsurer("Care");
} else {
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_id",
patientOneSecondInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_name",
patientOneSecondInsurerName,
);
}

patientPage.clickUpdatePatient();
cy.wait(3000);
patientPage.verifyPatientUpdated();
Expand Down Expand Up @@ -239,20 +250,24 @@ describe("Patient Creation with consultation", () => {
patientOneFirstPolicyId,
patientOneFirstInsurerId,
patientOneFirstInsurerName,
isHCXEnabled,
);

patientInsurance.clickPatientInsuranceViewDetail();
cy.wait(3000);
patientInsurance.verifyPatientPolicyDetails(
patientOneFirstSubscriberId,
patientOneFirstPolicyId,
patientOneFirstInsurerId,
patientOneFirstInsurerName,
isHCXEnabled,
);
patientInsurance.verifyPatientPolicyDetails(
patientOneSecondSubscriberId,
patientOneSecondPolicyId,
patientOneSecondInsurerId,
patientOneSecondInsurerName,
isHCXEnabled,
);
});

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ describe("User Creation", () => {
it("create new user form throwing mandatory field error", () => {
userCreationPage.clickElementById("addUserButton");
userCreationPage.clickElementById("submit");
cy.wait(2000);
userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES);
});

Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ describe("Manage User", () => {
manageUserPage.clickLinkFacility();
manageUserPage.clickUnlinkFacilityButton();
manageUserPage.clickSubmit();
manageUserPage.assertnotLinkedFacility;
manageUserPage.linkedfacilitylistnotvisible();
manageUserPage.clickCloseSlideOver();
// Go to particular facility doctor connect and all user-id are reflected based on there access
Expand Down
5 changes: 4 additions & 1 deletion cypress/pageobject/Facility/FacilityHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class FacilityHome {

// Operations
clickExportButton() {
cy.get(this.exportButton).scrollIntoView();
cy.get(this.exportButton).click();
}

Expand Down Expand Up @@ -89,7 +90,9 @@ class FacilityHome {
}

verifyDownload(alias: string) {
cy.wait(`@${alias}`).its("response.statusCode").should("eq", 200);
cy.wait(`@${alias}`, { timeout: 60000 })
.its("response.statusCode")
.should("eq", 200);
}

getURL() {
Expand Down
42 changes: 39 additions & 3 deletions cypress/pageobject/Patient/PatientInsurance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ class PatientInsurance {
});
}

selectInsurer(insurer: string) {
cy.intercept("GET", "**/api/v1/hcx/payors/**", {
statusCode: 200,
body: [
{
name: "test payor 2",
code: "testpayor2.swasthmock@swasth-hcx-staging",
},
{
name: "Care Payor",
code: "khavinshankar.gmail@swasth-hcx-staging",
},
{
name: "Alliance",
code: "hcxdemo.yopmail@swasth-hcx-staging",
},
],
}).as("getInsurer");
cy.get("[name='insurer']")
.last()
.click()
.type(insurer)
.then(() => {
cy.wait("@getInsurer");
cy.get("[role='option']").contains(insurer).click();
});
}

clickPatientInsuranceViewDetail() {
cy.get("#insurance-view-details").scrollIntoView();
cy.get("#insurance-view-details").click();
Expand All @@ -18,13 +46,21 @@ class PatientInsurance {
cy.get("[data-testid=add-insurance-button]").click();
}

verifyPatientPolicyDetails(subscriberId, policyId, insurerId, insurerName) {
verifyPatientPolicyDetails(
subscriberId,
policyId,
insurerId,
insurerName,
isHcxEnabled,
) {
cy.get("[data-testid=patient-details]").then(($dashboard) => {
cy.url().should("include", "/facility/");
expect($dashboard).to.contain(subscriberId);
expect($dashboard).to.contain(policyId);
expect($dashboard).to.contain(insurerId);
expect($dashboard).to.contain(insurerName);
if (!isHcxEnabled) {
expect($dashboard).to.contain(insurerId);
expect($dashboard).to.contain(insurerName);
}
});
}
}
Expand Down
10 changes: 8 additions & 2 deletions cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,14 @@ export class ManageUserPage {
}

assertDoctorConnectVisibility(realName) {
cy.get("#doctor-connect-home-doctor").should("contain.text", realName);
cy.get("#doctor-connect-remote-doctor").should("contain.text", realName);
cy.get('*[id="doctor-connect-home-doctor"]').should(
"contain.text",
realName,
);
cy.get('*[id="doctor-connect-remote-doctor"]').should(
"contain.text",
realName,
);
}

assertVideoConnectLink(docName: string, link: string) {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions public/config.json

This file was deleted.

Empty file removed public/env.json
Empty file.
3 changes: 1 addition & 2 deletions src/CAREUI/icons/CareIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import iconData from "./UniconPaths.json";
import { transformIcons } from "./icon";
import { useEffect } from "react";

import iconData from "./UniconPaths.json";

export type IconName = keyof typeof iconData;

export interface CareIconProps {
Expand Down
Loading

0 comments on commit d9f7b69

Please sign in to comment.