Skip to content

Commit

Permalink
Merge branch 'develop' into facility-features
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Sep 30, 2024
2 parents b058330 + fc4d499 commit 77501c4
Show file tree
Hide file tree
Showing 122 changed files with 2,818 additions and 1,633 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 @@
eyJrZXlzIjogW3sibiI6ICJ4X21fNGNKQ3NHTHN4WkFIa2VCbFZQa2ZqNFNSckdHN3UySERFM3VLX3dFNERhTWhHQ2lxTXFsaTFDM2pxSE5JTVhuWV9ab1M5R3pHbnJpdGg1UUZGVDlLMGtBdF9YaXBJNnV1djcwOWtOV2FFNXZrYks4VlFRcFd2UFp4NUJSeTBGay0wU2lxZG1xOTNJRXdUTnNTLUpETnRXQm5VX0F1cjU0UXptQmI3SmhfOGttRDAtaHhROVZVejRpSUU3QTlySU5vQXNHSHhfdGtuNXd6YmpPR3F2Q3JqRi1RWXo0OGJXVkZzVVliNkFqUlFrZER2RWVwQlpNSHZsNVUxQlZxOVdRTTJGTmRUR0tJb3ZYeDRuTDFybUVONHpxbEpqWmc2bEZiODVuOUhkc01VblFiSXhkUjVlVl8wWmNVaHBrQWc0NldrejRZWkxMNm5NaGR0RmFTMXciLCAiZSI6ICJBUUFCIiwgImQiOiAiRXo4T3dDZ2xxZnREWlhwSXVEbjhGck1KWGhNNHZfb0NDdlZNUko1QjBPd3BuR3BrWDRKZWF4VFJYYkZ5OVQzdkowX2VXZjRQcl9XZUloMk5HZnpkaGw5NmtJUzd5R2JxQkhSY0U3a2ZhVWFkbHlDTVdnZDV5TEk1aWVOQUw5N2w4X1o2N0w5NHRIX3VlUF80Q1pXV0hGVTNieXJ4bHVzSld6NmZ5SFVPczlVSDFxV284V1RNOVp0RndqV0cxOWpkUXZ1RkQ0Z0x4UEJYZEk5ZV9zdTNwbmZHR0ZkN0xfMDFwcEFkQ2Y5eHhNTWFEel8wZ0xXM0NENFhnWU1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ZGdLU3pMd2dCWTdEeUE3MkR2UG9CUHQtODgiLCAicWkiOiAiSlF0UUJERXdnQVVMcWJFRWoybmdyXy02aV9pUmdRWmJTQ0hXNGdpZG5fdHlwdUJWS2R0ZW1jT3J6M3NnTnk0ekZrZElTbUZfbmdnbFlJb080TjNza1NNUXdGY1B0S1kzWUVlT2ZGNzMzRDZaTVJtSTFTby12QU54YVBDUkREbnUwTWk1TnUzbS02SkhGSFF5RDU2ZTFsQUlwUS1lakpuTWR6MXQ0aUplbEFzIiwgImt0eSI6ICJSU0EiLCAia2lkIjogIlhjckcyVS0tR3B4SVhORXpKOWNWREdRaEUzeXlIamREMDN1aDZmYXpRX2siLCAiYWxnIjogIlJTMjU2In1dfQ==
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
56 changes: 56 additions & 0 deletions cypress/e2e/patient_spec/PatientBedManagement.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate";
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation";

describe("Patient swtich bed functionality", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientLogupdate = new PatientLogupdate();
const patientConsultationPage = new PatientConsultationPage();
const switchBedOne = "Dummy Bed 4";
const switchBedTwo = "Dummy Bed 1";
const switchBedThree = "Dummy Bed 3";
const switchPatientOne = "Dummy Patient 6";
const switchPatientTwo = "Dummy Patient 7";

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

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

it("Assign a bed for a admitted patient from update consultation page", () => {
// Open the update consultation page and assign a bed
patientPage.visitPatient(switchPatientTwo);
patientConsultationPage.clickEditConsultationButton();
patientLogupdate.selectBed(switchBedThree);
// verify the notification
cy.verifyNotification("Bed allocated successfully");
});

it("Assign a bed for a admitted patient from patient dashboard", () => {
// Assign a bed to a patient
patientPage.visitPatient(switchPatientOne);
patientLogupdate.clickSwitchBed();
patientLogupdate.selectBed(switchBedOne);
cy.verifyNotification("Bed allocated successfully");
// Clear the bed and reassign
patientLogupdate.clickSwitchBed();
cy.get("#clear-button").click();
patientLogupdate.selectBed(switchBedTwo);
cy.verifyNotification("Bed allocated successfully");
// verify the card is reflected
patientLogupdate.clickSwitchBed();
cy.verifyContentPresence("#previousbed-list", [switchBedOne, switchBedTwo]);
});

afterEach(() => {
cy.saveLocalStorage();
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("Patient Consultation in multiple combination", () => {
const patientWeight = "70";
const patientHeight = "170";
const medicineOne = "DOLOLUP";
const patientIpNumber = Math.random().toString(36).substring(7);
const patientIpNumber = `${Math.floor(Math.random() * 90 + 10)}/${Math.floor(Math.random() * 9000 + 1000)}`;

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand Down Expand Up @@ -94,7 +94,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.submitButton("Create Consultation");
// the above submit should fail as IP number is missing
patientConsultationPage.typePatientNumber(patientIpNumber);
patientConsultationPage.selectBed("Dummy Bed 1");
patientConsultationPage.selectBed("Dummy Bed 6");
cy.submitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// Below code for the prescription module only present while creating a new consultation
Expand Down
42 changes: 42 additions & 0 deletions cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import LoginPage from "../../pageobject/Login/LoginPage";
import PatientHome from "../../pageobject/Patient/PatientHome";

describe("Patient Homepage present functionalities", () => {
const loginPage = new LoginPage();
const patientHome = new PatientHome();

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

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

it("Verify the functionality of the patient tab pagination", () => {
let firstPatientPageOne: string;
cy.get('[data-cy="patient"]')
.first()
.invoke("text")
.then((patientOne: string) => {
firstPatientPageOne = patientOne.trim();
patientHome.clickNextPage();
patientHome.verifySecondPageUrl();
cy.get('[data-cy="patient"]')
.first()
.invoke("text")
.then((patientTwo: string) => {
const firstPatientPageTwo = patientTwo.trim();
expect(firstPatientPageOne).not.to.eq(firstPatientPageTwo);
patientHome.clickPreviousPage();
});
});
});

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

0 comments on commit 77501c4

Please sign in to comment.