Skip to content

Commit

Permalink
Merge branch 'develop' into issue-1438
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 authored Jan 27, 2025
2 parents 14d66e1 + 58e7a05 commit c05e3d3
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 71 deletions.
1 change: 1 addition & 0 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = defineConfig({
// implement node event listeners here
config.specPattern = [
"cypress/e2e/login.cy.js",
"cypress/e2e/home.cy.js",
"cypress/e2e/patientEntry.cy.js",
"cypress/e2e/orderEntity.cy.js",
"cypress/e2e/workplan.cy.js",
Expand Down
101 changes: 59 additions & 42 deletions frontend/cypress/e2e/batchOrderEntry.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before("login", () => {
loginPage.visit();
});

describe("Batch Order Entry On Demand", function () {
describe("Batch Order Entry On Demand and Serum form type", function () {
before("navigate to Batch Order Entry Page", function () {
navigateToBatchOrderEntryPage();
});
Expand All @@ -28,46 +28,63 @@ describe("Batch Order Entry On Demand", function () {
batchOrder.checkNextButtonDisabled();
});

it("Should Select Form And Samples", function () {
it("User selects Routine Form and Serum Sample", function () {
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.selectForm(batchOrderData.formTypeRoutine);
batchOrder.selectSampleType(batchOrderData.sampleType);
batchOrder.selectPanel(3);
batchOrder.selectSampleType(batchOrderData.serumSample);
});
});

it("User checks Panels and Tests", function () {
batchOrder.checkBilanPanel();
batchOrder.checkSerologiePanel();
//tests picked at random
batchOrder.checkDenguePCR();
batchOrder.checkHIVViralLoad();
batchOrder.checkCreatinine();
});

it("Should Select Methods, Site Name and Move to Next Page", function () {
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.selectMethod(batchOrderData.methodOnDemand);
batchOrder.checkFacilityCheckbox();
batchOrder.checkPatientCheckbox();
batchOrder.enterSiteName(batchOrderData.siteName);
batchOrder.checkNextButtonEnabled();
});
});

it("Should Visit Batch Order Entry Page", function () {
batchOrder.visitBatchOrderEntryPage();
it("User adds New Patient", function () {
batchOrder.clickNewPatientButton();
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.uniqueHealthIDNum(batchOrderData.healthID);
batchOrder.nationalID(batchOrderData.nationalID);
batchOrder.firstName(batchOrderData.firstName);
batchOrder.lastName(batchOrderData.lastName);
batchOrder.typePatientYears(batchOrderData.years);
batchOrder.typePatientMonths(batchOrderData.months);
batchOrder.typePatientDays(batchOrderData.days);
batchOrder.selectGender(); //female in this case
});
});
//Save button is lacking and needs to be added for this test to work
//it("User should click save new patient information button", function () {
// batchOrder.clickSavePatientButton();
//});

it("Should Validate Fields And Generate BarCode", function () {
it("Generate BarCode", function () {
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.validateField(
":nth-child(1) > .cds--subgrid > :nth-child(8)",
batchOrderData.sampleType,
);
batchOrder.validateField(".cds--lg\\:col-span-12", batchOrderData.panel);
batchOrder.validateField(
":nth-child(1) > .cds--subgrid > :nth-child(13)",
batchOrderData.facility,
);
batchOrder.checkNextLabel().should("be.disabled");
batchOrder.typeLabNumber(batchOrderData.labNumber);
batchOrder.clickGenerateAndSaveBarcode();
batchOrder.checkNextLabel().should("be.visible");
});
});
});

describe("Batch Order Entry Pre Printed", function () {
it("User clicks the finish button", function () {
batchOrder.clickFinishButton();
});
});
describe("Batch Order Entry Pre Printed and EID form type", function () {
before("navigate to Batch Order Entry Page", function () {
navigateToBatchOrderEntryPage();
});
Expand All @@ -77,15 +94,16 @@ describe("Batch Order Entry Pre Printed", function () {
batchOrder.checkNextButtonDisabled();
});

it("Should Select Form And Samples", function () {
it("User selects EID form, samples and test", function () {
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.selectForm(batchOrderData.formTypeRoutine);
batchOrder.selectSampleType(batchOrderData.sampleType);
batchOrder.selectPanel(3);
batchOrder.selectForm(batchOrderData.formTypeEID);
batchOrder.selectDNAPCRTest();
batchOrder.selectTubeSample();
batchOrder.selectBloodSample();
});
});

it("Should Select Methods, Site Name and Move to Next Page", function () {
it("User Selects Methods, Site Name and Move to Next Page", function () {
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.selectMethod(batchOrderData.methodPrePrinted);
batchOrder.checkFacilityCheckbox();
Expand All @@ -95,30 +113,29 @@ describe("Batch Order Entry Pre Printed", function () {
});
});

it("User Searches for Existing Patient", function () {
batchOrder.clickSearchPatientButton();
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.lastName(batchOrderData.lastName);
batchOrder.firstName(batchOrderData.firstName);
batchOrder.localSearchButton();
batchOrder.checkPatientRadio(); //the first on the list
});
});

it("Should Visit Batch Order Entry Page", function () {
batchOrder.visitBatchOrderEntryPage();
});

it("Should Validate Fields", function () {
it(" User enters Lab Number and Generates Barcode", function () {
cy.fixture("BatchOrder").then((batchOrderData) => {
batchOrder.validateField(
":nth-child(1) > .cds--subgrid > :nth-child(8)",
batchOrderData.sampleType,
);
batchOrder.validateField(".cds--lg\\:col-span-12", batchOrderData.panel);
batchOrder.validateField(
":nth-child(1) > .cds--subgrid > :nth-child(13)",
batchOrderData.facility,
);
batchOrder.typeLabNumber(batchOrderData.labNumber);
batchOrder.visitBatchOrderEntryPage();
batchOrder.clickGenerateButton();
batchOrder.saveOrder();
});
});

it("Should Search For Patient And Generate Barcode", function () {
batchOrder.selectPatientGender(2);
batchOrder.clickSearchPatient();
batchOrder.selectPatient(1);

batchOrder.clickGenerateButton();
batchOrder.saveOrder();
it("User clicks the finish button", function () {
batchOrder.clickFinishButton();
});
});
58 changes: 58 additions & 0 deletions frontend/cypress/e2e/home.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import LoginPage from "../pages/LoginPage";

let loginPage = null;
let home = null;

before(() => {
loginPage = new LoginPage();
loginPage.visit();

home = loginPage.goToHomePage();
});

//This action runs after each test
afterEach(() => {
home.afterAll();
});

describe("User navigates to different tiles", function () {
it("User navigates to the In Progress", function () {
home.selectInProgress();
});

it("User navigates to Ready for Validation", function () {
home.selectReadyforValidation();
});

it("User navigates to Orders Completed Today", function () {
home.selectOrdersCompletedToday();
});

it("User navigates to Partially Completed Today", function () {
home.selectPartiallyCompletedToday();
});

it("User navigates to Orders Entered By Users", function () {
home.selectOrdersEnteredByUsers();
});

it("User navigates to Orders Rejected", function () {
home.selectOrdersRejected();
});

it("User navigates to UnPrinted Results", function () {
home.selectUnPrintedResults();
});

it("User navigates to Electronic Orders", function () {
home.selectElectronicOrders();
});

it("User navigates to Average Turn Around time", function () {
home.selectAverageTurnAroundTime();
});

it("User navigates to Delayed Turn Around", function () {
home.selectDelayedTurnAround();
});
});
16 changes: 14 additions & 2 deletions frontend/cypress/fixtures/BatchOrder.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
{
"formTypeRoutine": "Routine",
"sampleType": "Serum",
"formTypeEID": "EID",
"formTypeViralLoad": "Viral Load",
"serumSample": "Serum",
"methodOnDemand": "On Demand",
"methodPrePrinted": "Pre-Printed",
"siteName": "CAMES",
"panel": "Western blot HIV",
"facility": "279 - CAMES MAN"
"facility": "279 - CAMES MAN",
"labNumber": "123456",
"firstName": "John",
"lastName": "Smith",
"subjectNumber": "001202782410",
"healthID": "03445656410",
"nationalID": "UG-23SLHD7DBD",
"years": "47",
"months": "9",
"days": "12",
"labNo": "DEV01240000000000001"
}
Loading

0 comments on commit c05e3d3

Please sign in to comment.