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; Sep Week 2 #6252

Merged
merged 20 commits into from
Sep 9, 2023
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
f535fd3
Enhance UI of Import External Results page (#6163)
Pranshu1902 Sep 5, 2023
b0c61dc
Medicine: Adds `type` filter for medibase search (#6186)
rithviknishad Sep 5, 2023
14f6ff1
remove extra space (#6215)
Pranshu1902 Sep 5, 2023
1631e79
remove extra loader and add success notification (#6210)
Pranshu1902 Sep 5, 2023
9d9bb5e
Bug Fixed : Default filters on patients page loads (#6189)
mustafaazad03 Sep 5, 2023
bbb07b7
Support for direnv and use `CARE_API` from env in vite config (#6201)
rithviknishad Sep 5, 2023
539beec
Added nav link for bed status in consultation form (#6170)
suprabathk Sep 6, 2023
55c0ae0
Medicine Administrations: Adds `administered_date` input (#6206)
rithviknishad Sep 6, 2023
dcc7b70
Fix casing of plausible goal properties (#6229)
Ashesh3 Sep 6, 2023
8a6e526
Diagnosis: Adds field Principal Diagnosis (#6218)
rithviknishad Sep 6, 2023
b94851c
open pdf file preview in new tab (#6226)
Ashesh3 Sep 6, 2023
995f4d7
Changed weekly to average weekly for working hours (#6228)
kshitijv256 Sep 6, 2023
fe36bd0
Fix fullscreen button for IOS (#6225)
Ashesh3 Sep 7, 2023
3f1a0cb
Added test for importing and configuring an asset and migrated patien…
ShivamJhaa Sep 7, 2023
e1f00fa
Added test for resource, facility and migrated them to POM approach (…
ShivamJhaa Sep 7, 2023
0c2be8b
User (Doctor) Autocomplete for Consultation Verified By (#6194)
rithviknishad Sep 7, 2023
4519b08
Temporarily expose abdm health facility config directly (#6197)
khavinshankar Sep 8, 2023
8bcf91d
cypress: fix inventory management (#6245)
rithviknishad Sep 8, 2023
9b45c5e
Fix verified_by and Principal Diagnosis validation (#6247)
Ashesh3 Sep 8, 2023
fb4e7be
Consultation Form: skip validation for `verified_by` if `suggestion` …
rithviknishad Sep 8, 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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test -f .env.local && dotenv .env.local
4 changes: 1 addition & 3 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- name: Check care is up ♻
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000

- name: Change api proxy url 📝
run: 'sed --in-place "s^target: .*,^target: \"http://localhost:9000\",^g" vite.config.ts'

- name: Install dependencies 📦
run: npm install

Expand All @@ -55,6 +52,7 @@ jobs:
browser: chrome
record: true
env:
CARE_API: http://localhost:9000
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096
Expand Down
68 changes: 66 additions & 2 deletions cypress/e2e/assets_spec/assets_manage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <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 Expand Up @@ -84,7 +85,9 @@ describe("Asset", () => {
"Test note for asset creation!"
);

assetPage.interceptAssetCreation();
assetPage.clickCreateAsset();
assetPage.verifyAssetCreation();
assetPage.verifySuccessNotification("Asset created successfully");

assetSearchPage.typeSearchKeyword("New Test Asset 2");
Expand All @@ -104,19 +107,80 @@ describe("Asset", () => {
"Manufacturer's Name Edited",
"Customer Support's Name Edited",
"Vendor's Name Edited",
"Test note for asset creation edited!"
"Test note for asset creation edited!",
"25122021"
);

assetPage.clickUpdateAsset();

assetPage.verifySuccessNotification("Asset updated successfully");
});

it("Configure an asset", () => {
assetPage.openCreatedAsset();
assetPage.spyAssetConfigureApi();
assetPage.configureAsset(
"Host name",
"192.168.1.64",
"remote_user",
"2jCkrCRSeahzKEU",
"d5694af2-21e2-4a39-9bad-2fb98d9818bd"
);
assetPage.clickConfigureAsset();
assetPage.verifyAssetConfiguration(200);
});

it("Add an vital monitor asset and configure it", () => {
assetPage.createAsset();
assetPage.selectFacility("Dummy Facility 1");
assetPage.selectLocation("Camera Loc");
assetPage.selectAssetType("Internal");
assetPage.selectAssetClass("HL7 Vitals Monitor");

const qr_id_1 = uuidv4();

assetPage.enterAssetDetails(
"New Test Asset Vital",
"Test Description",
"Working",
qr_id_1,
"Manufacturer's Name",
"2025-12-25",
"Customer Support's Name",
phone_number,
"[email protected]",
"Vendor's Name",
serialNumber,
"25122021",
"Test note for asset creation!"
);
assetPage.interceptAssetCreation();
assetPage.clickCreateAsset();
assetPage.verifyAssetCreation();

assetSearchPage.typeSearchKeyword("New Test Asset Vital");
assetSearchPage.pressEnter();

assetPage.openCreatedAsset();
assetPage.configureVitalAsset("Host name", "192.168.1.64");
assetPage.clickConfigureVital();
});

it("Delete an Asset", () => {
assetPage.openCreatedAsset();
assetPage.interceptDeleteAssetApi();
assetPage.deleteAsset();
assetPage.verifyDeleteStatus();
});

it("Import new asset", () => {
assetPage.selectImportOption();
assetPage.selectImportFacility("Dummy Facility 1");
assetPage.importAssetFile();
assetPage.selectImportLocation("Camera Locations");
assetPage.clickImportAsset();

assetPage.verifySuccessNotification("Asset deleted successfully");
assetPage.verifySuccessNotification("Assets imported successfully");
});

afterEach(() => {
Expand Down
41 changes: 40 additions & 1 deletion cypress/e2e/facility_spec/facility.cy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// FacilityCreation
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("Facility Creation", () => {
let facilityUrl: string;
const facilityPage = new FacilityPage();
const loginPage = new LoginPage();
const phone_number = "9999999999";

before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

Expand Down Expand Up @@ -51,6 +55,7 @@ describe("Facility Creation", () => {
facilityPage.visitUpdateFacilityPage(facilityUrl);
facilityPage.clickManageFacilityDropdown();
facilityPage.clickUpdateFacilityOption();
facilityPage.clickUpdateFacilityType();
facilityPage.fillFacilityName("cypress facility updated");
facilityPage.fillAddress("Cypress Facility Updated Address");
facilityPage.fillOxygenCapacity("100");
Expand All @@ -61,6 +66,40 @@ describe("Facility Creation", () => {
cy.url().should("not.include", "/update");
});

it("Configure the existing facility", () => {
facilityPage.visitUpdateFacilityPage(facilityUrl);
facilityPage.clickManageFacilityDropdown();
facilityPage.clickConfigureFacilityOption();
facilityPage.fillMiddleWareAddress("dev_middleware.coronasafe.live");
facilityPage.clickupdateMiddleWare();
facilityPage.verifySuccessNotification("Facility updated successfully");
});

it("Create a resource request", () => {
facilityPage.visitUpdateFacilityPage(facilityUrl);
facilityPage.clickManageFacilityDropdown();
facilityPage.clickResourceRequestOption();
facilityPage.fillResourceRequestDetails(
"Test User",
phone_number,
"cypress",
"Test title",
"10",
"Test description"
);
facilityPage.clickSubmitRequestButton();
facilityPage.verifySuccessNotification(
"Resource request created successfully"
);
});

it("Delete a facility", () => {
facilityPage.visitUpdateFacilityPage(facilityUrl);
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
28 changes: 13 additions & 15 deletions cypress/e2e/facility_spec/inventory.cy.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("Inventory Management Section", () => {
const facilityPage = new FacilityPage();
const loginPage = new LoginPage();

before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
loginPage.loginAsDisctrictAdmin();
cy.saveLocalStorage();
});

beforeEach(() => {
cy.restoreLocalStorage();
cy.awaitUrl("/");
cy.viewport(1280, 720);
cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
cy.get("[id='facility-details']").first().click();
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("#manage-facility-dropdown button").should("be.visible");
cy.get("[id='manage-facility-dropdown']").scrollIntoView().click();
cy.get("[id=inventory-management]").click();
});

it("Adds Inventory", () => {
cy.contains("Manage Inventory").click();
cy.get("div#id").click();
cy.get("div#id ul li").contains("Liquid Oxygen").click();
cy.get("div#isIncoming").click();
cy.get("div#isIncoming ul li").contains("Add Stock").click();
cy.get("[name='quantity']").type("120");
cy.get("button").contains("Add/Update Inventory").click();
cy.verifyNotification("Inventory created successfully");
facilityPage.visitAlreadyCreatedFacility();
facilityPage.clickManageFacilityDropdown();
facilityPage.clickInventoryManagementOption();
facilityPage.clickManageInventory();
facilityPage.fillInventoryDetails("Liquid Oxygen", "Add Stock", "120");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
});

afterEach(() => {
Expand Down
Loading
Loading