Skip to content

Commit

Permalink
Added test for importing and configuring an asset and migrated patien…
Browse files Browse the repository at this point in the history
…t_crud.ts to POM approach (ohcnetwork#5870)

* Added test for importing and configuring an asset

* Revert few changes

* nits

* Migrated to POM approach

* Migrated patient_crud to POM approach

* reverted some chnages

* FIx

* Merge conflicts

* Fixed test

* add responsiveness to virtual nursing assistant card (ohcnetwork#6130)

* allow use stock as well (ohcnetwork#6115)

* fixed responsive issue of 'Update Log' button in patient consultation page (ohcnetwork#6113)

* fix multiple bed bug (ohcnetwork#6111)

* Fixed typo in Date format in Asset management (ohcnetwork#6105)

* Added padding to count block on patients page

* fixed date format in asset manage page

* show only items with no min value (ohcnetwork#6103)

* check for id in response (ohcnetwork#6100)

* Added Responsiveness to File upload (ohcnetwork#6096)

* add responsiveness

* refactor

* remove overlap (ohcnetwork#6094)

* fixed failing test

* Fix

* Fixed comments

* fix comments

* Fixed all comments

---------

Co-authored-by: Pranshu Aggarwal <[email protected]>
Co-authored-by: Gokulram A <[email protected]>
Co-authored-by: Kshitij Verma <[email protected]>
Co-authored-by: Mohammed Nihal <[email protected]>
  • Loading branch information
5 people authored Sep 7, 2023
1 parent fe36bd0 commit 3f1a0cb
Show file tree
Hide file tree
Showing 12 changed files with 612 additions and 201 deletions.
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
Loading

0 comments on commit 3f1a0cb

Please sign in to comment.