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

[fix] Updated the patientEntry E2E #1455

Draft
wants to merge 64 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
583e270
Updated patientEntry E2E
Bahati308 Jan 27, 2025
7a52730
Updated the patientEntry E2E
Bahati308 Jan 28, 2025
2bcbf48
Merge branch 'develop' into E2E-fixes
Bahati308 Jan 28, 2025
86a8817
Merge branch 'develop' into E2E-fixes
mozzy11 Jan 28, 2025
75353ba
Fixes
Bahati308 Jan 28, 2025
0e0af17
Fixes
Bahati308 Jan 28, 2025
3585ca2
Merge branch 'develop' into E2E-fixes
Bahati308 Jan 28, 2025
82b63df
Merge branch 'develop' into E2E-fixes
Bahati308 Jan 28, 2025
3c0d601
Updated patientEntryPage.js
Bahati308 Jan 29, 2025
fe1fb35
Merge branch 'E2E-fixes' of https://github.com/Bahati308/OpenELIS-Glo…
Bahati308 Jan 29, 2025
cf13579
Merge branch 'develop' into E2E-fixes
Bahati308 Jan 29, 2025
aec7187
Merge branch 'develop' into E2E-fixes
Bahati308 Jan 30, 2025
92d90c3
Made modifications
Bahati308 Jan 30, 2025
9cd4746
made modifications
Bahati308 Jan 31, 2025
52e41bf
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 1, 2025
e45bf1e
Mada changes
Bahati308 Feb 1, 2025
d9d879e
Merge branch 'E2E-fixes' of https://github.com/Bahati308/OpenELIS-Glo…
Bahati308 Feb 1, 2025
5d27b3b
Made changes
Bahati308 Feb 1, 2025
14496f5
Made changes
Bahati308 Feb 1, 2025
a886297
Made changes
Bahati308 Feb 1, 2025
eced629
Made changes
Bahati308 Feb 1, 2025
61a8953
made changes
Bahati308 Feb 1, 2025
5af8f2c
made changes
Bahati308 Feb 1, 2025
4e33d22
made changes
Bahati308 Feb 2, 2025
8307a02
made changes
Bahati308 Feb 2, 2025
ac023d1
made changes
Bahati308 Feb 2, 2025
8f91345
updates
Bahati308 Feb 2, 2025
ace2e83
updates
Bahati308 Feb 2, 2025
d24731d
updates
Bahati308 Feb 2, 2025
711d069
updates
Bahati308 Feb 2, 2025
aeb1b5a
updates
Bahati308 Feb 2, 2025
64bd2fe
updates
Bahati308 Feb 2, 2025
f8e33ff
updates
Bahati308 Feb 2, 2025
509cb7c
updates
Bahati308 Feb 2, 2025
e68652d
Made Modifications
Bahati308 Feb 2, 2025
51c4309
Made Modifications
Bahati308 Feb 2, 2025
918f344
Made Modifications
Bahati308 Feb 2, 2025
e401426
Made Modifications
Bahati308 Feb 2, 2025
2e108e3
updated modify
Bahati308 Feb 2, 2025
dd6e5b1
updated modify
Bahati308 Feb 2, 2025
3e4d16e
Added Changes
Bahati308 Feb 2, 2025
8cc4d90
Added Changes
Bahati308 Feb 3, 2025
2ae2077
Added Changes
Bahati308 Feb 3, 2025
3cb6341
modify fixes
Bahati308 Feb 3, 2025
ccafdbf
Update
Bahati308 Feb 3, 2025
34daf81
made Updates
Bahati308 Feb 3, 2025
2936286
made updates
Bahati308 Feb 3, 2025
444befa
made updates
Bahati308 Feb 3, 2025
a719674
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 3, 2025
2f1864b
made updates
Bahati308 Feb 3, 2025
c933107
Merge branch 'E2E-fixes' of https://github.com/Bahati308/OpenELIS-Glo…
Bahati308 Feb 3, 2025
da83725
Updates
Bahati308 Feb 4, 2025
a361c4f
Updates
Bahati308 Feb 4, 2025
117ca31
Updates
Bahati308 Feb 4, 2025
3a8a96f
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 5, 2025
e5cd268
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 10, 2025
4eea82f
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 10, 2025
c5efa59
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 11, 2025
1508167
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 11, 2025
92c0e30
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 11, 2025
8f06e6a
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 12, 2025
c92b1d0
Updates
Bahati308 Feb 12, 2025
65a7d5b
Upadted modifyOrder
Bahati308 Feb 12, 2025
a3d7eb3
Merge branch 'develop' into E2E-fixes
Bahati308 Feb 12, 2025
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
129 changes: 27 additions & 102 deletions frontend/cypress/e2e/modifyOrder.cy.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
import LoginPage from "../pages/LoginPage";
import PatientEntryPage from "../pages/PatientEntryPage";
import OrderEntityPage from "../pages/OrderEntityPage";

let homePage = null;
let loginPage = null;
let modifyOrderPage = null;
let patientPage = new PatientEntryPage();
let orderEntityPage = new OrderEntityPage();

before("login", () => {
loginPage = new LoginPage();
loginPage.visit();
});

describe("Modify Order search by accession Number", function () {
it("User Visits Home Page and goes to Modify Order Page ", function () {
homePage = loginPage.goToHomePage();
modifyOrderPage = homePage.goToModifyOrderPage();
});

it("User searches with accession number", () => {
cy.wait(1000);
cy.fixture("EnteredOrder").then((order) => {
modifyOrderPage.enterAccessionNo(order.labNo);
modifyOrderPage.clickSubmitButton();
});
});

it("should check for program selection button and go to next page ", function () {
modifyOrderPage.checkProgramButton();
modifyOrderPage.clickNextButton();
});

it("should be able to record", function () {
modifyOrderPage.assignValues();
});

it("User should click next to go add order page and submit the order", function () {
modifyOrderPage.clickNextButton();
cy.wait(1000);
modifyOrderPage.clickNextButton();
});

it("should be able to print barcode", function () {
cy.window().then((win) => {
cy.spy(win, "open").as("windowOpen");
});
modifyOrderPage.clickPrintBarcodeButton();
cy.get("@windowOpen").should(
"be.calledWithMatch",
"/api/OpenELIS-Global/LabelMakerServlet?labNo=",
);
});
});
//"Modify Order search by accession Number", is a WIP.

describe("Modify Order search by patient ", function () {
it("User Visits Home Page and goes to Modify Order Page ", function () {
Expand All @@ -61,77 +24,39 @@ describe("Modify Order search by patient ", function () {
it("Should search Patient By First and LastName", function () {
cy.wait(1000);
cy.fixture("Patient").then((patient) => {
patientPage.searchPatientByFirstAndLastName(
patient.firstName,
patient.lastName,
);
patientPage.getFirstName().should("have.value", patient.firstName);
patientPage.getLastName().should("have.value", patient.lastName);

patientPage.getLastName().should("not.have.value", patient.inValidName);

modifyOrderPage.clickSearchPatientButton();
patientPage.validatePatientSearchTable(
patient.firstName,
patient.inValidName,
);
patientPage.patientFirstName(patient.firstName);
patientPage.patientLastName(patient.lastName);
});
cy.wait(200).reload();
});

it("Should be able to search patients By gender", function () {
cy.wait(1000);
patientPage.getMaleGenderRadioButton().should("be.visible");
patientPage.getMaleGenderRadioButton().click();
cy.wait(200);
modifyOrderPage.clickSearchPatientButton();
cy.fixture("Patient").then((patient) => {
patientPage.validatePatientByGender("M");
});
cy.wait(200).reload();
patientPage.clickSearchBtn();
patientPage.selectPatient();
cy.wait(800);
modifyOrderPage.clickNextButton();
});

it("should search patient By PatientId", function () {
cy.wait(1000);
cy.fixture("Patient").then((patient) => {
patientPage.searchPatientByPatientId(patient.nationalId);
modifyOrderPage.clickSearchPatientButton();
patientPage.validatePatientSearchTable(
patient.firstName,
patient.inValidName,
);
});
});
//TO DO needs fixing
it("Should be able to search by respective patient ", function () {
cy.wait(1000);
modifyOrderPage.clickRespectivePatient();
});
it("should check for program selection button and go to next page ", function () {
cy.wait(1000);
modifyOrderPage.checkProgramButton();
it("User adds sample", function () {
modifyOrderPage.selectSerum();
orderEntityPage.checkPanelCheckBoxField();
modifyOrderPage.clickRejectSample();
modifyOrderPage.rejectReason();
modifyOrderPage.clickNextButton();
});

it("should be able to record", function () {
cy.wait(1000);
modifyOrderPage.assignValues();
it("Add Order", function () {
modifyOrderPage.generateLabOrderNumber();
cy.fixture("Order").then((order) => {
orderEntityPage.searchRequester(order.requester);
orderEntityPage.requesterFName(order.requesterFName);
orderEntityPage.requesterLName(order.requesterLName);
orderEntityPage.enterSiteName(order.siteName);
});
});

it("User should click next to go add order page and submit the order", function () {
modifyOrderPage.clickNextButton();
cy.wait(1000);
modifyOrderPage.clickNextButton();
it("Result Reporting and Submit Order", function () {
modifyOrderPage.checkPatientEmail();
modifyOrderPage.clickSubmitButton();
});

it("should be able to print barcode", function () {
cy.window().then((win) => {
cy.spy(win, "open").as("windowOpen");
});
modifyOrderPage.clickPrintBarcodeButton();
cy.get("@windowOpen").should(
"be.calledWithMatch",
"/api/OpenELIS-Global/LabelMakerServlet?labNo=",
);
it("User Prints Barcode", function () {
modifyOrderPage.printBarCode();
});
});
8 changes: 4 additions & 4 deletions frontend/cypress/e2e/nonConform.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ describe("Report Non-Conforming Event", function () {
nonConform.selectSearchType("Patient Identification Code");
nonConform.enterSearchField(patient.nationalId);
nonConform.clickSearchButton();
cy.fixture("EnteredOrder").then((order) => {
cy.fixture("Order").then((order) => {
nonConform.validateSearchResult(order.labNo);
});
});
});

it("Should Search by Lab Number ", function () {
cy.fixture("EnteredOrder").then((order) => {
cy.fixture("Order").then((order) => {
nonConform.selectSearchType("Lab Number");
nonConform.enterSearchField(order.labNo);
nonConform.clickSearchButton();
Expand Down Expand Up @@ -99,7 +99,7 @@ describe("View New Non-Conforming Event", function () {
.should("contain.text", "View New Non Conform Event");
});
it("Should Search by Lab Number and Validate the results", function () {
cy.fixture("EnteredOrder").then((order) => {
cy.fixture("Order").then((order) => {
nonConform.selectSearchType("Lab Number");
nonConform.enterSearchField(order.labNo);
nonConform.clickSearchButton();
Expand Down Expand Up @@ -147,7 +147,7 @@ describe("Corrective Actions", function () {
.should("contain.text", "Nonconforming Events Corrective Action");
});
it("Should Search by Lab Number and Validate the results", function () {
cy.fixture("EnteredOrder").then((order) => {
cy.fixture("Order").then((order) => {
nonConform.selectSearchType("Lab Number");
nonConform.enterSearchField(order.labNo);
nonConform.clickSearchButton();
Expand Down
40 changes: 17 additions & 23 deletions frontend/cypress/e2e/orderEntity.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import LoginPage from "../pages/LoginPage";
//import OrderEntityPage from "../pages/OrderEntityPage";

let homePage = null;
let loginPage = null;
Expand All @@ -16,29 +17,23 @@ describe("Order Entity", function () {
orderEntityPage = homePage.goToOrderPage();
});

it("Should search patient in the search box", function () {
it("User searches patient by First and Last Names", function () {
patientEntryPage = orderEntityPage.getPatientPage();
cy.wait(1000);
cy.fixture("Patient").then((patient) => {
patientEntryPage.searchPatientByFirstAndLastName(
patient.firstName,
patient.lastName,
);
patientEntryPage.clickSearchPatientButton();
patientEntryPage.validatePatientSearchTable(
patient.firstName,
patient.inValidName,
);
patientEntryPage.selectPatientFromSearchResults();
cy.wait(200);
patientEntryPage.getFirstName().should("have.value", patient.firstName);
patientEntryPage.getLastName().should("have.value", patient.lastName);
patientEntryPage.patientFirstName(patient.firstName);
patientEntryPage.patientLastName(patient.lastName);
});
patientEntryPage.clickSearchBtn();
});

it("User should click next to go to program selection", function () {
it("User checks patient from the table", function () {
patientEntryPage.selectPatient();
});
it("User clicks next to go to program selection", function () {
orderEntityPage.clickNextButton();
cy.wait(1000);
cy.fixture("Order").then((order) => {
orderEntityPage.selectProgram(order.program);
});
orderEntityPage.clickNextButton();
});

Expand All @@ -58,7 +53,7 @@ describe("Order Entity", function () {
orderEntityPage.validateAcessionNumber(order.invalidLabNo);
});
orderEntityPage.generateLabOrderNumber();
cy.get("#labNo").then(($input) => {
cy.get("#displaylab_labNo").then(($input) => {
const generatedOrderNumber = $input.val();
cy.fixture("Order").then((order) => {
order.labNo = generatedOrderNumber;
Expand All @@ -76,14 +71,13 @@ describe("Order Entity", function () {
});
});

it("should enter requester first and last name's", function () {
it("should enter requester first and last names", function () {
cy.fixture("Order").then((order) => {
orderEntityPage.enterRequesterLastAndFirstName(
order.requester.firstName,
order.requester.lastName,
);
orderEntityPage.searchRequester(order.requester);
});
cy.wait(500);
});

it("should click submit order button", function () {
orderEntityPage.clickSubmitOrderButton();
});
Expand Down
Loading
Loading