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; Spetember Week 3 #6295

Merged
merged 23 commits into from
Sep 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ca51ef1
Refactor Consultation Details (#6258)
thtauhid Sep 11, 2023
ac9a4ee
Add validation for average working hours (#6243)
Ashesh3 Sep 11, 2023
3d73c69
changed priority of backUrl and history for back button in pageTitle …
kshitijv256 Sep 11, 2023
baecaab
Asset filter parameters reset on unselect (#6255)
print-Sathvik Sep 11, 2023
4e8005c
Make the form consistent (#6238)
Pranshu1902 Sep 11, 2023
7cda789
Disabled asset config for user other than admin (#6259)
thtauhid Sep 11, 2023
2da1eee
add test to search asset by qr and serial number (#6266)
nihal467 Sep 12, 2023
203288e
remove quotes from `.env`, gitignore bun lock file (#6263)
rithviknishad Sep 12, 2023
f7ac333
remove `REACT_APP_CONFIG` from `.env` (#6268)
rithviknishad Sep 12, 2023
dd1dcc3
fix load dummy data command (#6270)
sainak Sep 12, 2023
d0ffbd5
Refactor workflow to properly wait for migrations (#6272)
Ashesh3 Sep 12, 2023
8c242d6
Asset CSV export (#6262)
Ashesh3 Sep 12, 2023
87f36ba
add readmission (#6239)
rithviknishad Sep 12, 2023
3fdf1d5
Add Consultation button is now conditionally active (#6260)
thtauhid Sep 12, 2023
8a704af
Added None option in admitted_to bed filters so that we can filter fo…
yaswanthsaivendra Sep 12, 2023
f72a1cf
verify asset filter (#6275)
nihal467 Sep 13, 2023
cc6b570
Vitals Monitor (HL7): Add support to detect multiple ecg wavenames (#…
rithviknishad Sep 13, 2023
2956fa9
fix `goBack` precedence (#6285)
rithviknishad Sep 14, 2023
c5f3b79
Implements `useQuery` & `request` data fetching utilities (used in Lo…
rithviknishad Sep 14, 2023
d790af0
Cypress parallel (#6273)
mathew-alex Sep 14, 2023
5ac9e15
Fixed Cypress Failure in Facility and Resource Page (#6293)
nihal467 Sep 15, 2023
6b8f706
Add Cypress test to Assets Export Functionality (#6291)
nihal467 Sep 15, 2023
0167315
Cam reset (#6286)
khavinshankar Sep 15, 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
Prev Previous commit
Next Next commit
Add Cypress test to Assets Export Functionality (#6291)
* verify asset filter

* Add Test for Add Export and verify existing test

* reverse vite config
  • Loading branch information
nihal467 authored Sep 15, 2023
commit 6b8f706f4a58c00372fa1bb9d98c1803b53bb2ee
24 changes: 24 additions & 0 deletions cypress/e2e/assets_spec/asset_homepage.cy.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { v4 as uuidv4 } from "uuid";

@@ -13,6 +14,7 @@ describe("Asset Tab", () => {
const assetQRScanPage = new AssetQRScanPage();
const assetPagination = new AssetPagination();
const assetFilters = new AssetFilters();
const assetPage = new AssetPage();
const loginPage = new LoginPage();
const assetName = "Dummy Camera 10";
const qrCode = uuidv4();
@@ -83,6 +85,28 @@ describe("Asset Tab", () => {
assetPagination.navigateToPreviousPage();
});

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

it("verify imported asset", () => {
assetSearchPage.typeSearchKeyword("New Test Asset");
assetSearchPage.pressEnter();
assetSearchPage.verifyAssetIsPresent("New Test Asset");
});

it("Export asset", () => {
assetPage.selectassetimportbutton();
assetPage.selectjsonexportbutton();
assetPage.selectcsvexportbutton();
});

afterEach(() => {
cy.saveLocalStorage();
});
178 changes: 178 additions & 0 deletions cypress/e2e/assets_spec/assets_creation.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
/// <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";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";

describe("Asset", () => {
const assetPage = new AssetPage();
const assetSearchPage = new AssetSearchPage();
const loginPage = new LoginPage();
const phone_number = "9999999999";
const serialNumber = Math.floor(Math.random() * 10 ** 10).toString();

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

beforeEach(() => {
cy.restoreLocalStorage();
cy.awaitUrl("/assets");
});

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

assetPage.verifyEmptyAssetNameError();
assetPage.verifyEmptyAssetTypeError();
assetPage.verifyEmptyLocationError();
assetPage.verifyEmptyStatusError();
assetPage.verifyEmptyPhoneError();
});

//Create an asset

it("Create an Asset", () => {
assetPage.createAsset();
assetPage.selectFacility("Dummy Facility 1");
assetPage.selectLocation("Camera Loc");
assetPage.selectAssetType("Internal");
assetPage.selectAssetClass("ONVIF Camera");

const qr_id_1 = uuidv4();

assetPage.enterAssetDetails(
"New Test Asset 1",
"Test Description",
"Working",
qr_id_1,
"Manufacturer's Name",
"2025-12-25",
"Customer Support's Name",
phone_number,
"email@support.com",
"Vendor's Name",
serialNumber,
"25122021",
"Test note for asset creation!"
);

assetPage.clickCreateAddMore();
assetPage.verifySuccessNotification("Asset created successfully");

const qr_id_2 = uuidv4();

assetPage.selectLocation("Camera Loc");
assetPage.selectAssetType("Internal");
assetPage.selectAssetClass("ONVIF Camera");
assetPage.enterAssetDetails(
"New Test Asset 2",
"Test Description",
"Working",
qr_id_2,
"Manufacturer's Name",
"2025-12-25",
"Customer Support's Name",
phone_number,
"email@support.com",
"Vendor's Name",
serialNumber,
"25122021",
"Test note for asset creation!"
);

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

assetSearchPage.typeSearchKeyword("New Test Asset 2");
assetSearchPage.pressEnter();
assetSearchPage.verifyAssetIsPresent("New Test Asset 2");
});

it("Edit an Asset", () => {
assetPage.openCreatedAsset();

const qr_id = uuidv4();

assetPage.editAssetDetails(
"New Test Asset Edited",
"Test Description Edited",
qr_id,
"Manufacturer's Name Edited",
"Customer Support's Name Edited",
"Vendor's Name Edited",
"Test note for asset creation edited!",
"25122021"
);

assetPage.clickUpdateAsset();

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

it("Verify Editted Asset", () => {
assetSearchPage.typeSearchKeyword("New Test Asset Edited");
assetSearchPage.pressEnter();
assetSearchPage.verifyAssetIsPresent("New Test Asset Edited");
});

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@support.com",
"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();
});

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