Skip to content

Commit

Permalink
Merge branch 'develop' into rithviknishad/chore/uninstall-redux
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Oct 15, 2024
2 parents 094b11e + a45285a commit c6d247e
Show file tree
Hide file tree
Showing 126 changed files with 2,858 additions and 4,749 deletions.
1 change: 0 additions & 1 deletion .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ REACT_KASP_FULL_STRING=Karunya Arogya Suraksha Padhathi

# Sample format file paths
REACT_SAMPLE_FORMAT_ASSET_IMPORT=/asset-import-template.xlsx
REACT_SAMPLE_FORMAT_EXTERNAL_RESULT_IMPORT=/External-Results-Template.csv

# Camera feed, still watching idle timeout (in seconds; default: 180)
REACT_STILL_WATCHING_IDLE_TIMEOUT=
Expand Down
3 changes: 0 additions & 3 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ const careConfig = {
sampleFormats: {
assetImport:
env.REACT_SAMPLE_FORMAT_ASSET_IMPORT || "/asset-import-template.xlsx",
externalResultImport:
env.REACT_SAMPLE_FORMAT_EXTERNAL_RESULT_IMPORT ||
"/External-Results-Template.csv",
},

wartimeShifting: env.REACT_WARTIME_SHIFTING === "true",
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ describe("Asset Tab", () => {
it("Export asset", () => {
assetPage.selectassetimportbutton();
cy.wait(2000);
assetPage.selectjsonexportbutton();
assetPage.selectJsonExportButton();
assetPage.selectassetimportbutton();
assetPage.selectcsvexportbutton();
assetPage.selectCsvExportButton();
});

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/assets_spec/AssetsCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe("Asset", () => {
"d5694af2-21e2-4a39-9bad-2fb98d9818bd",
);
assetPage.clickConfigureAsset();
assetPage.verifyAssetConfiguration(200);
assetPage.verifyAssetConfiguration();
});

it("Add an vital monitor asset and configure it", () => {
Expand Down
41 changes: 0 additions & 41 deletions cypress/e2e/external_results_spec/ExternalResultsAdvanceFilters.ts

This file was deleted.

68 changes: 0 additions & 68 deletions cypress/e2e/external_results_spec/ExternalResultsHomepage.cy.ts

This file was deleted.

5 changes: 4 additions & 1 deletion cypress/e2e/patient_spec/PatientFileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const loginPage = new LoginPage();
const patientPage = new PatientPage();
const patientFileUpload = new PatientFileUpload();

function runTests(testDescription, visitPatientFileUploadSection) {
function runTests(
testDescription: string,
visitPatientFileUploadSection: () => void,
) {
describe(testDescription, () => {
const cypressAudioName = "cypress audio";
const cypressFileName = "cypress name";
Expand Down
140 changes: 140 additions & 0 deletions cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ import PatientHome from "../../pageobject/Patient/PatientHome";
describe("Patient Homepage present functionalities", () => {
const loginPage = new LoginPage();
const patientHome = new PatientHome();
const patientGender = "Male";
const patientCategory = "Moderate";
const patientMinimumAge = "18";
const patientMaximumAge = "24";
const patientLastAdmittedBed = "No bed assigned";
const PatientLastConsentType = "No consents";
const patientTelemedicinePerference = "No";
const patientReviewStatus = "No";
const patientMedicoStatus = "Non-Medico-Legal";
const patientIcdDiagnosis = "1A00";
const facilityName = "Dummy Facility 40";
const facilityType = "Private Hospital";
const facilityLsgBody = "Aikaranad Grama Panchayat, Ernakulam District";
const facilityDistrict = "Ernakulam";
const patientFromDate = "01122023";
const patientToDate = "07122023";
const patientFromDateBadge = "2023-12-01";
const patientToDateBadge = "2023-12-07";

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand All @@ -16,6 +34,128 @@ describe("Patient Homepage present functionalities", () => {
cy.awaitUrl("/patients");
});

it("Date based advance filters applied in the patient tab", () => {
patientHome.clickPatientAdvanceFilters();
patientHome.typePatientCreatedBeforeDate(patientFromDate);
patientHome.typePatientCreatedAfterDate(patientToDate);
patientHome.typePatientModifiedBeforeDate(patientFromDate);
patientHome.typePatientModifiedAfterDate(patientToDate);
patientHome.typePatientAdmitedBeforeDate(patientFromDate);
patientHome.typePatientAdmitedAfterDate(patientToDate);
patientHome.clickPatientFilterApply();
patientHome.verifyTotalPatientCount("1");
// verify the badge and clear the count
patientHome.verifyPatientCreatedBeforeDate(patientToDateBadge);
patientHome.verifyPatientCreatedAfterDate(patientFromDateBadge);
patientHome.verifyPatientModifiedBeforeDate(patientToDateBadge);
patientHome.verifyPatientModifiedAfterDate(patientFromDateBadge);
patientHome.verifyPatientAdmittedBeforeDate(patientToDateBadge);
patientHome.verifyPatientAdmittedAfterDate(patientFromDateBadge);
cy.clearAllFilters();
patientHome.verifyTotalPatientCount("1");
});

it("Facility Geography based advance filters applied in the patient tab", () => {
patientHome.clickPatientAdvanceFilters();
patientHome.typeFacilityName(facilityName);
patientHome.selectFacilityType(facilityType);
patientHome.typeFacilityLsgBody(facilityLsgBody);
patientHome.typeFacilityDistrict(facilityDistrict);
patientHome.clickPatientFilterApply();
patientHome.verifyTotalPatientCount("1");
// Clear the badges and verify the patient count along with badges
patientHome.verifyFacilityNameBadgeContent(facilityName);
patientHome.verifyFacilityTypeBadgeContent(facilityType);
patientHome.verifyFacilityLsgBadgeContent(facilityLsgBody);
patientHome.verifyFacilityDistrictContent(facilityDistrict);
cy.clearAllFilters();
patientHome.verifyTotalPatientCount("1");
});

it("Patient diagnosis based advance filters applied in the patient tab", () => {
// Patient Filtering based on icd-11 data
patientHome.clickPatientAdvanceFilters();
patientHome.selectAnyIcdDiagnosis(patientIcdDiagnosis, patientIcdDiagnosis);
patientHome.selectConfirmedIcdDiagnosis(
patientIcdDiagnosis,
patientIcdDiagnosis,
);
patientHome.selectUnconfirmedIcdDiagnosis(
patientIcdDiagnosis,
patientIcdDiagnosis,
);
patientHome.selectProvisionalIcdDiagnosis(
patientIcdDiagnosis,
patientIcdDiagnosis,
);
patientHome.selectDifferentialIcdDiagnosis(
patientIcdDiagnosis,
patientIcdDiagnosis,
);
patientHome.clickPatientFilterApply();
patientHome.verifyTotalPatientCount("0");
// verify the badges presence in the platform
patientHome.verifyAnyDiagnosisBadgeContent(patientIcdDiagnosis);
patientHome.verifyConfirmedDiagnosisBadgeContent(patientIcdDiagnosis);
patientHome.verifyUnconfirmedDiagnosisBadgeContent(patientIcdDiagnosis);
patientHome.verifyProvisionalDiagnosisBadgeContent(patientIcdDiagnosis);
patientHome.verifyDifferentialDiagnosisBadgeContent(patientIcdDiagnosis);
// Clear the badges and verify the patient count along with badges
cy.clearAllFilters();
patientHome.verifyTotalPatientCount("1");
// Apply Any and confirmed diagonsis to verify patient count 17
patientHome.clickPatientAdvanceFilters();
patientHome.selectAnyIcdDiagnosis(patientIcdDiagnosis, patientIcdDiagnosis);
patientHome.selectConfirmedIcdDiagnosis(
patientIcdDiagnosis,
patientIcdDiagnosis,
);
patientHome.clickPatientFilterApply();
patientHome.verifyTotalPatientCount("1");
});

it("Patient Details based advance filters applied in the patient tab", () => {
// Patient Filtering based on patient details
patientHome.clickPatientAdvanceFilters();
patientHome.selectPatientGenderfilter(patientGender);
patientHome.selectPatientCategoryfilter(patientCategory);
patientHome.typePatientMinimumAgeFilter(patientMinimumAge);
patientHome.typePatientMaximumAgeFilter(patientMaximumAge);
patientHome.selectPatientLastAdmittedBed(patientLastAdmittedBed);
patientHome.selectPatientLastConsentType(PatientLastConsentType);
patientHome.selectPatientTelemedicineFilter(patientTelemedicinePerference);
patientHome.selectPatientReviewFilter(patientReviewStatus);
patientHome.selectPatientMedicoFilter(patientMedicoStatus);
patientHome.clickPatientFilterApply();
cy.get("a[data-cy='patient']").should("contain.text", "Dummy Patient");
patientHome.verifyTotalPatientCount("1");
// Verify the presence of badges
patientHome.verifyGenderBadgeContent(patientGender);
patientHome.verifyCategoryBadgeContent(patientCategory);
patientHome.verifyMinAgeBadgeContent(patientMinimumAge);
patientHome.verifyMaxAgeBadgeContent(patientMaximumAge);
patientHome.verifyLastAdmittedBedBadgeContent(patientLastAdmittedBed);
patientHome.verifyLastConsentTypeBadgeContent("No Consents");
patientHome.verifyTelemedicineBadgeContent("false");
patientHome.verifyReviewMissedBadgeContent("false");
patientHome.verifyMedicoBadgeContent("false");
// Clear the badges and verify the patient count along with badges
cy.clearAllFilters();
patientHome.verifyTotalPatientCount("1");
});

it("Export the live patient list based on a date range", () => {
patientHome.clickPatientExport();
cy.verifyNotification("Please select a seven day period");
cy.closeNotification();
patientHome.typePatientModifiedBeforeDate("01122023");
patientHome.typePatientModifiedAfterDate("07122023");
patientHome.clickPatientFilterApply();
patientHome.interceptPatientExportRequest();
patientHome.clickPatientExport();
patientHome.verifyPatientExportRequest();
});

it("Verify the functionality of the patient tab pagination", () => {
let firstPatientPageOne: string;
cy.get('[data-cy="patient"]')
Expand Down
8 changes: 2 additions & 6 deletions cypress/e2e/sample_test_spec/SampleTestHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ describe("Sample List", () => {
it("Search by District name", () => {
cy.intercept(/\/api\/v1\/test_sample/).as("test_sample");
cy.get("[name='district_name']").type("Test");
cy.wait("@test_sample").then((interception) => {
expect(interception.response.statusCode).to.equal(200);
});
cy.wait("@test_sample").its("response.statusCode").should("eq", 200);
cy.url().should("include", "Test");
});

it("Search by Patient Name", () => {
cy.intercept(/\/api\/v1\/test_sample/).as("test_sample");
cy.get("[name='patient_name']").type("Test");
cy.wait("@test_sample").then((interception) => {
expect(interception.response.statusCode).to.equal(200);
});
cy.wait("@test_sample").its("response.statusCode").should("eq", 200);
cy.url().should("include", "Test");
});

Expand Down
20 changes: 6 additions & 14 deletions cypress/pageobject/Asset/AssetCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ export class AssetPage {
cy.intercept(/\/api\/v1\/asset/).as("asset");
}

verifyAssetConfiguration(statusCode: number) {
cy.wait("@asset").then((interception) => {
expect(interception.response.statusCode).to.equal(statusCode);
});
verifyAssetConfiguration() {
cy.wait("@asset").its("response.statusCode").should("eq", 200);
}

clickConfigureAsset() {
Expand Down Expand Up @@ -222,22 +220,16 @@ export class AssetPage {
cy.get("[data-testid=import-asset-button]").click();
}

selectjsonexportbutton() {
selectJsonExportButton() {
cy.intercept("GET", "**/api/v1/asset/?**json=true**").as("getJsonexport");
cy.get("#export-json-option").click();
cy.wait("@getJsonexport").then(({ request, response }) => {
expect(response.statusCode).to.eq(200);
expect(request.url).to.include("json=true");
});
cy.wait("@getJsonexport").its("response.statusCode").should("eq", 200);
}

selectcsvexportbutton() {
selectCsvExportButton() {
cy.intercept("GET", "**/api/v1/asset/?**csv=true**").as("getCsvexport");
cy.get("#export-csv-option").click();
cy.wait("@getCsvexport").then(({ request, response }) => {
expect(response.statusCode).to.eq(200);
expect(request.url).to.include("csv=true");
});
cy.wait("@getCsvexport").its("response.statusCode").should("eq", 200);
}

selectImportOption() {
Expand Down
8 changes: 4 additions & 4 deletions cypress/pageobject/Asset/AssetFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ export class AssetFilters {
cy.get("#close-slide-over").click();
}
// Assertions
assertFacilityText(text) {
assertFacilityText(text: string) {
cy.get("[data-testid=Facility]").should("contain", text);
}
assertAssetClassText(text) {
assertAssetClassText(text: string) {
cy.get("[data-testid='Asset Class']").should("contain", text);
}
assertStatusText(text) {
assertStatusText(text: string) {
cy.get("[data-testid=Status]").should("contain", text);
}
assertLocationText(text) {
assertLocationText(text: string) {
cy.get("[data-testid=Location]").should("contain", text);
}
}
Loading

0 comments on commit c6d247e

Please sign in to comment.