Skip to content

Commit

Permalink
Merge branch 'develop' into queryCR
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 authored Aug 15, 2024
2 parents bb27300 + 95b9bbe commit c12c445
Show file tree
Hide file tree
Showing 31 changed files with 2,353 additions and 1,033 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontend-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
submodules: recursive

- name: Run OpenELS image
run: docker-compose -f build.docker-compose.yml up -d
run: docker compose -f build.docker-compose.yml up -d

- name: Sleep for 2 minutes
run: sleep 2m
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
repository: ${{github.repository}}

- name: Run OpenELS image
run: docker-compose -f test.docker-compose.yml up -d
run: docker compose -f test.docker-compose.yml up -d

- name: Cypress run
uses: cypress-io/github-action@v6
Expand Down
1 change: 1 addition & 0 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = defineConfig({
"cypress/e2e/workplan.cy.js",
"cypress/e2e/nonConform.cy.js",
"cypress/e2e/modifyOrder.cy.js",
"cypress/e2e/batchOrderEntry.cy.js",
];
return config;
},
Expand Down
124 changes: 124 additions & 0 deletions frontend/cypress/e2e/batchOrderEntry.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import LoginPage from "../pages/LoginPage";

let homePage = null;
let loginPage = null;
let batchOrder = null;

const navigateToBatchOrderEntryPage = () => {
homePage = loginPage.goToHomePage();
batchOrder = homePage.goToBatchOrderEntry();
};

before(() => {
cy.fixture("BatchOrder").as("batchOrderData");
});

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

describe("Batch Order Entry On Demand", function () {
before("navigate to Batch Order Entry Page", function () {
navigateToBatchOrderEntryPage();
});

it("User visits Batch Order Entry Setup Page", function () {
batchOrder.visitSetupPage();
batchOrder.checkNextButtonDisabled();
});

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

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

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

it("Should Validate Fields And 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.clickGenerateAndSaveBarcode();
batchOrder.checkNextLabel().should("be.visible");
});
});
});

describe("Batch Order Entry Pre Printed", function () {
before("navigate to Batch Order Entry Page", function () {
navigateToBatchOrderEntryPage();
});

it("User visits Batch Order Entry Setup Page", function () {
batchOrder.visitSetupPage();
batchOrder.checkNextButtonDisabled();
});

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

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

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

it("Should Validate Fields", 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,
);
});
});

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

batchOrder.clickGenerateButton();
batchOrder.saveOrder();
});
});
9 changes: 9 additions & 0 deletions frontend/cypress/fixtures/BatchOrder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"formTypeRoutine": "Routine",
"sampleType": "Serum",
"methodOnDemand": "On Demand",
"methodPrePrinted": "Pre-Printed",
"siteName": "CAMES",
"panel": "Western blot HIV",
"facility": "279 - CAMES MAN"
}
86 changes: 86 additions & 0 deletions frontend/cypress/pages/BatchOrderEntryPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
class BatchOrderEntry {
visitSetupPage() {
cy.get("h2").should("contain.text", "Batch Order Entry Setup");
}

checkNextButtonDisabled() {
cy.get(":nth-child(12) > .cds--btn").should("be.disabled");
}

selectForm(formType) {
cy.get("#form-dropdown").select(formType);
}

selectSampleType(sampleType) {
cy.get("#selectSampleType").should("be.visible").select(sampleType);
}

selectPanel(panelIndex) {
cy.get(
`:nth-child(${panelIndex}) > :nth-child(5) > .cds--checkbox-label`,
).click();
}

checkNextLabel() {
return cy.get(":nth-child(8) > .cds--btn");
}

clickGenerateButton() {
cy.get(":nth-child(2) > .cds--link").click();
}

selectMethod(method) {
cy.get("#method-dropdown").select(method);
}

checkFacilityCheckbox() {
cy.get(":nth-child(5) > .cds--form-item > .cds--checkbox-label").click();
}

checkPatientCheckbox() {
cy.get(":nth-child(6) > .cds--form-item > .cds--checkbox-label").click();
}

enterSiteName(siteName) {
cy.get("#siteName").type(siteName);
cy.get(".suggestion-active").should("be.visible").click();
}

checkNextButtonEnabled() {
cy.get(":nth-child(12) > .cds--btn").should("not.be.disabled").click();
}

visitBatchOrderEntryPage() {
cy.get("h2").should("contain.text", "Batch Order Entry");
}

validateField(tagId, expectedText) {
cy.get(tagId).should("contain.text", expectedText);
}

clickGenerateAndSaveBarcode() {
cy.get(".cds--link > p").click();
}

saveOrder() {
cy.get(":nth-child(6) > .cds--btn").click();
}

checkNextButtonVisible() {
cy.get(":nth-child(8) > .cds--btn").should("be.visible");
}

selectPatientGender(genderIndex) {
cy.get(`:nth-child(${genderIndex}) > .cds--radio-button__label`).click(); // 2 for male, 3 for female
}

clickSearchPatient() {
cy.get("#local_search").click();
}

selectPatient(rowIndex) {
cy.get(`tbody > :nth-child(${rowIndex}) > :nth-child(1)`).click();
}
}

export default BatchOrderEntry;
48 changes: 28 additions & 20 deletions frontend/cypress/pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import OrderEntityPage from "./OrderEntityPage";
import ModifyOrderPage from "./ModifyOrderPage";
import WorkPlan from "./WorkPlan";
import NonConform from "./NonConformPage";
import BatchOrderEntry from "./BatchOrderEntryPage";

class HomePage {
constructor() {}
Expand All @@ -18,8 +19,8 @@ class HomePage {

goToOrderPage() {
this.openNavigationMenu();
cy.get("#menu_sample").click();
cy.get("#menu_sample_add").click();
cy.get("#menu_sample_dropdown").click();
cy.get("#menu_sample_add_nav").click();
return new OrderEntityPage();
}

Expand All @@ -29,64 +30,71 @@ class HomePage {
}).click();
}

goToBatchOrderEntry() {
this.openNavigationMenu();
cy.get("#menu_sample_dropdown").click();
cy.get("#menu_sample_batch_entry_nav").click();
return new BatchOrderEntry();
}

goToPatientEntry() {
this.openNavigationMenu();
cy.get("#menu_patient").click();
cy.get("#menu_patient_add_or_edit").click();
cy.get("#menu_patient_dropdown").click();
cy.get("#menu_patient_add_or_edit_nav").click();
return new PatientEntryPage();
}

goToModifyOrderPage() {
this.openNavigationMenu();
cy.get("#menu_sample").click();
cy.get("#menu_sample_edit").click();
cy.get("#menu_sample_dropdown").click();
cy.get("#menu_sample_edit_nav").click();
return new ModifyOrderPage();
}
goToWorkPlanPlanByTest() {
this.openNavigationMenu();
cy.get("#menu_workplan").click();
cy.get("#menu_workplan_test").click();
cy.get("#menu_workplan_dropdown").click();
cy.get("#menu_workplan_test_nav").click();
return new WorkPlan();
}

goToWorkPlanPlanByPanel() {
this.openNavigationMenu();
cy.get("#menu_workplan").click();
cy.get("#menu_workplan_panel").click();
cy.get("#menu_workplan_dropdown").click();
cy.get("#menu_workplan_panel_nav").click();
return new WorkPlan();
}

goToWorkPlanPlanByUnit() {
this.openNavigationMenu();
cy.get("#menu_workplan").click();
cy.get("#menu_workplan_bench").click();
cy.get("#menu_workplan_dropdown").click();
cy.get("#menu_workplan_bench_nav").click();
return new WorkPlan();
}

goToWorkPlanPlanByPriority() {
this.openNavigationMenu();
cy.get("#menu_workplan").click();
cy.get("#menu_workplan_priority").click();
cy.get("#menu_workplan_dropdown").click();
cy.get("#menu_workplan_priority_nav").click();
return new WorkPlan();
}

goToReportNCE() {
this.openNavigationMenu();
cy.get("#menu_nonconformity").click();
cy.get("#menu_non_conforming_report").click();
cy.get("#menu_nonconformity_dropdown").click();
cy.get("#menu_non_conforming_report_nav").click();
return new NonConform();
}

goToViewNCE() {
this.openNavigationMenu();
cy.get("#menu_nonconformity").click();
cy.get("#menu_non_conforming_view").click();
cy.get("#menu_nonconformity_dropdown").click();
cy.get("#menu_non_conforming_view_nav").click();
return new NonConform();
}
goToCorrectiveActions() {
this.openNavigationMenu();
cy.get("#menu_nonconformity").click();
cy.get("#menu_non_conforming_corrective_actions").click();
cy.get("#menu_nonconformity_dropdown").click();
cy.get("#menu_non_conforming_corrective_actions_nav").click();
return new NonConform();
}
}
Expand Down
11 changes: 8 additions & 3 deletions frontend/src/components/Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,18 @@ button {
padding-left: 1rem !important;
}

.cds--side-nav__link:hover {
.top-level-menu-item > a {
pointer-events: auto !important;
text-decoration: none !important;
}

.top-level-menu-item > a:hover {
background-color: var(--cds-background-hover, #072655);
}

/* .cds--side-nav__link {
#mainHeader .cds--side-nav__link {
pointer-events: none
} */
}

@media screen and (max-width: 792px) {
.banner h5 {
Expand Down
Loading

0 comments on commit c12c445

Please sign in to comment.