diff --git a/frontend/cypress.config.js b/frontend/cypress.config.js index f5b9f83351..a48f5dd3fa 100755 --- a/frontend/cypress.config.js +++ b/frontend/cypress.config.js @@ -20,6 +20,7 @@ module.exports = defineConfig({ "cypress/e2e/report.cy.js", "cypress/e2e/batchOrderEntry.cy.js", "cypress/e2e/dashboard.cy.js", + "cypress/e2e/labNumberManagement.cy.js", ]; return config; }, diff --git a/frontend/cypress/e2e/labNumberManagement.cy.js b/frontend/cypress/e2e/labNumberManagement.cy.js new file mode 100644 index 0000000000..0f2bb2ce39 --- /dev/null +++ b/frontend/cypress/e2e/labNumberManagement.cy.js @@ -0,0 +1,44 @@ +import LoginPage from "../pages/LoginPage"; + +let loginPage = null; +let homePage = null; +let adminPage = null; +let labNumMgtPage = null; + +before(() => { + // Initialize LoginPage object and navigate to Admin Page + loginPage = new LoginPage(); + loginPage.visit(); + + homePage = loginPage.goToHomePage(); + adminPage = homePage.goToAdminPage(); +}); + +beforeEach(() => { + // Load fixture data for each test + cy.fixture("LabNumberManagement").as("labNMData"); +}); + +describe("Lab Number Management", function () { + it("User navigates to the Lab Number Management page", function () { + labNumMgtPage = adminPage.goToLabNumberManagementPage(); + }); + + it("User selects legacy lab number type and submits", function () { + cy.get("@labNMData").then((labNumberManagementData) => { + labNumMgtPage.selectLabNumber( + labNumberManagementData.legacyLabNumberType, + ); + labNumMgtPage.clickSubmitButton(); + }); + }); + + it("User selects alpha numeric lab number type and submits", function () { + cy.get("@labNMData").then((labNumberManagementData) => { + labNumMgtPage.selectLabNumber(labNumberManagementData.alphaLabNumberType); + labNumMgtPage.checkPrefixCheckBox(); + labNumMgtPage.typePrefix(labNumberManagementData.userPrefix); + labNumMgtPage.clickSubmitButton(); + }); + }); +}); diff --git a/frontend/cypress/fixtures/LabNumberManagement.json b/frontend/cypress/fixtures/LabNumberManagement.json new file mode 100644 index 0000000000..46792a45c1 --- /dev/null +++ b/frontend/cypress/fixtures/LabNumberManagement.json @@ -0,0 +1,5 @@ +{ + "alphaLabNumberType": "Alpha Numeric", + "legacyLabNumberType": "Legacy", + "userPrefix": "REG-" +} diff --git a/frontend/cypress/pages/AdminPage.js b/frontend/cypress/pages/AdminPage.js new file mode 100644 index 0000000000..0d059f1a02 --- /dev/null +++ b/frontend/cypress/pages/AdminPage.js @@ -0,0 +1,33 @@ +//This handles all pages of the admin +import LabNumberManagementPage from "./LabNumberManagementPage"; + +class AdminPage { + constructor() {} + + visit() { + cy.visit("/administration"); //need to confirm this + } + //this page is also included in the homepage + goToAdminPage() { + this.openNavigationMenu(); + cy.get("#menu_administration").click(); + cy.get("#menu_administration_nav").click(); + return new AdminPage(); + } + + //lab number management + goToLabNumberManagementPage() { + // Click on the element using the provided selector + cy.get("a.cds--side-nav__link[href='#labNumber']") + .should("be.visible") // Ensure the element is visible + .click(); // Click to navigate to the page + + // Verify the URL or some unique identifier of the target page + cy.url().should("include", "#labNumber"); // Validate URL fragment + cy.contains("Lab Number Management").should("be.visible"); // Confirm presence of the page content + + return new LabNumberManagementPage(); // Return the page object + } +} + +export default AdminPage; diff --git a/frontend/cypress/pages/HomePage.js b/frontend/cypress/pages/HomePage.js index dfedb13fc3..ff7c338a7c 100755 --- a/frontend/cypress/pages/HomePage.js +++ b/frontend/cypress/pages/HomePage.js @@ -12,6 +12,7 @@ import RoutineReportPage from "./RoutineReportPage"; import StudyReportPage from "./StudyReportPage"; import DashBoardPage from "./DashBoard"; +import AdminPage from "./AdminPage"; class HomePage { constructor() {} @@ -192,6 +193,12 @@ class HomePage { cy.get("#menu_immunochemdashboard_nav").click(); return new DashBoardPage(); } + + goToAdminPage() { + this.openNavigationMenu(); + cy.get("#menu_administration").click(); + return new AdminPage(); + } } export default HomePage; diff --git a/frontend/cypress/pages/LabNumberManagementPage.js b/frontend/cypress/pages/LabNumberManagementPage.js new file mode 100644 index 0000000000..8eb30188e6 --- /dev/null +++ b/frontend/cypress/pages/LabNumberManagementPage.js @@ -0,0 +1,30 @@ +class LabNumberManagementPage { + constructor() {} + + verifyPageLoaded() { + // Confirm the page is loaded by checking a unique element + cy.contains("Lab Number Management").should("be.visible"); + } + + selectLabNumber(labNumberType) { + // Ensure the dropdown is visible and interactable + cy.get("#lab_number_type").should("be.visible").select(labNumberType); // Select the lab number type passed as an argument + } + + checkPrefixCheckBox() { + cy.get("#usePrefix").check({ force: true }); // Check the checkbox + } + typePrefix(prefix) { + this.checkPrefixCheckBox(); + + // Wait for the input to become enabled + cy.get("#alphanumPrefix").should("not.be.disabled").type(prefix); + } + clickSubmitButton() { + cy.get("button.cds--btn.cds--btn--primary[type='submit']") + .should("be.visible") + .click(); + } +} + +export default LabNumberManagementPage; diff --git a/frontend/src/components/admin/Admin.js b/frontend/src/components/admin/Admin.js index 65832d2e17..d7f42db76d 100644 --- a/frontend/src/components/admin/Admin.js +++ b/frontend/src/components/admin/Admin.js @@ -396,54 +396,63 @@ function Admin() { diff --git a/frontend/src/components/admin/BatchTestReassignmentAndCancellation/BatchTestReassignmentAndCancelation.js b/frontend/src/components/admin/BatchTestReassignmentAndCancellation/BatchTestReassignmentAndCancelation.js index 1fd1783d94..7ec885deff 100644 --- a/frontend/src/components/admin/BatchTestReassignmentAndCancellation/BatchTestReassignmentAndCancelation.js +++ b/frontend/src/components/admin/BatchTestReassignmentAndCancellation/BatchTestReassignmentAndCancelation.js @@ -407,7 +407,7 @@ function BatchTestReassignmentAndCancelation() { {notificationVisible === true ? : ""}
- +
diff --git a/frontend/src/components/admin/barcodeConfiguration/BarcodeConfiguration.js b/frontend/src/components/admin/barcodeConfiguration/BarcodeConfiguration.js index e60b2647a3..96cba22818 100644 --- a/frontend/src/components/admin/barcodeConfiguration/BarcodeConfiguration.js +++ b/frontend/src/components/admin/barcodeConfiguration/BarcodeConfiguration.js @@ -29,6 +29,10 @@ import BarcodeConfigurationFormValues from "../../formModel/innitialValues/Barco let breadcrumbs = [ { label: "home.label", link: "/" }, { label: "breadcrums.admin.managment", link: "/MasterListsPage" }, + { + label: "sidenav.label.admin.barcodeconfiguration", + link: "/MasterListsPage#barcodeConfiguration", + }, ]; function BarcodeConfiguration() { const { notificationVisible, setNotificationVisible, addNotification } = diff --git a/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx b/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx index ee0b9fb105..a92ee2bf23 100644 --- a/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx +++ b/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx @@ -38,7 +38,14 @@ import { } from "../../common/CustomNotification"; import PageBreadCrumb from "../../common/PageBreadCrumb"; -const breadcrumbs = [{ label: "home.label", link: "/" }]; +const breadcrumbs = [ + { label: "home.label", link: "/" }, + { label: "breadcrums.admin.managment", link: "/MasterListsPage" }, + { + label: "sidenav.label.admin.testmgt.calculated", + link: "/MasterListsPage#calculatedValue", + }, +]; interface CalculatedValueProps {} type TestListField = "TEST_RESULT" | "FINAL_RESULT"; @@ -623,7 +630,7 @@ const CalculatedValue: React.FC = () => { return (
- +
diff --git a/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js b/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js index 2d4eca72a6..bf6ccce46b 100644 --- a/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js +++ b/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js @@ -35,7 +35,6 @@ import { FormattedMessage, useIntl } from "react-intl"; import PageBreadCrumb from "../../../common/PageBreadCrumb.js"; import GenericConfigEdit from "../../generalConfig/common/GenericConfigEdit.js"; -let breadcrumbs = [{ label: "home.label", link: "/" }]; function ConfigMenuDisplay(props) { const { notificationVisible, setNotificationVisible, addNotification } = useContext(NotificationContext); @@ -54,6 +53,12 @@ function ConfigMenuDisplay(props) { const [ConfigEdit, setConfigEdit] = useState(false); + let breadcrumbs = [ + { label: "home.label", link: "/" }, + { label: "breadcrums.admin.managment", link: "/MasterListsPage" }, + { label: `${props.label}`, link: `/MasterListsPage#${props.menuType}` }, + ]; + function handleModify(event) { event.preventDefault(); setConfigEdit(true); @@ -185,7 +190,7 @@ function ConfigMenuDisplay(props) { {notificationVisible === true ? : ""}
- +
diff --git a/frontend/src/components/admin/labNumber/LabNumberManagement.js b/frontend/src/components/admin/labNumber/LabNumberManagement.js index 96bf9f5054..dd3a707e53 100644 --- a/frontend/src/components/admin/labNumber/LabNumberManagement.js +++ b/frontend/src/components/admin/labNumber/LabNumberManagement.js @@ -28,7 +28,14 @@ import { FormattedMessage, useIntl } from "react-intl"; import { ConfigurationContext } from "../../layout/Layout"; import PageBreadCrumb from "../../common/PageBreadCrumb.js"; -let breadcrumbs = [{ label: "home.label", link: "/" }]; +let breadcrumbs = [ + { label: "home.label", link: "/" }, + { label: "breadcrums.admin.managment", link: "/MasterListsPage" }, + { + label: "sidenav.label.admin.labNumber", + link: "/MasterListsPage#labNumber", + }, +]; function LabNumberManagement() { const intl = useIntl(); @@ -159,7 +166,7 @@ function LabNumberManagement() { {loading && }
- +
@@ -169,7 +176,7 @@ function LabNumberManagement() {
- +
- +
diff --git a/frontend/src/components/admin/testManagement/ViewTestCatalog.js b/frontend/src/components/admin/testManagement/ViewTestCatalog.js index e0b570b52f..07bb3ba9c0 100644 --- a/frontend/src/components/admin/testManagement/ViewTestCatalog.js +++ b/frontend/src/components/admin/testManagement/ViewTestCatalog.js @@ -330,7 +330,7 @@ const TestCatalog = () => {
- +

{" "} diff --git a/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js b/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js index 6ef6f8e534..9f3515d3b6 100644 --- a/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js +++ b/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js @@ -265,41 +265,43 @@ function TestNotificationConfigMenu() {
- +
-
- - - -
+ + + +
+
+
+ + {" "} + +
-
- - - {" "} - - - -

diff --git a/frontend/src/components/admin/userManagement/UserManagement.js b/frontend/src/components/admin/userManagement/UserManagement.js index b8ae04f069..8db8e6b3a0 100644 --- a/frontend/src/components/admin/userManagement/UserManagement.js +++ b/frontend/src/components/admin/userManagement/UserManagement.js @@ -353,7 +353,7 @@ function UserManagement() { {notificationVisible === true ? : ""}
- +
diff --git a/pom.xml b/pom.xml index 9f1628c75e..c10c26e9ee 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 1 0 - 1 + 2 UTF-8 ${project.basedir}/liquibase/liquibase.properties 1.4.1