Skip to content

Commit

Permalink
Merge branch 'develop' into Help_Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vsvishalsharma authored Jan 23, 2025
2 parents c9ed3de + 2e269e6 commit aa19fab
Show file tree
Hide file tree
Showing 22 changed files with 373 additions and 58 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/publish-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:

jobs:
build-and-push-test-image-backend:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
build-args: SKIP_SPOTLESS=true

build-and-push-test-image-frontend:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -105,6 +107,7 @@ jobs:
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache,mode=max

build-and-push-test-image-proxy:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -146,6 +149,7 @@ jobs:
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-proxy:buildcache,mode=max

build-and-push-test-image-fhir:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -303,6 +307,7 @@ jobs:
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache,mode=max

build-and-push-image-proxy:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -344,6 +349,7 @@ jobs:
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-proxy:buildcache,mode=max

build-and-push-image-fhir:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-dev-backend-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:

jobs:
build-and-push-image-backend-dev:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -83,6 +84,7 @@ jobs:
retention-days: 1

merge-backend-dev-platform-images:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
needs:
- build-and-push-image-backend-dev
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-dev-frontend-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:

jobs:
build-and-push-image-frontend-dev:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -85,6 +86,7 @@ jobs:
retention-days: 1

merge-frontend-dev-platform-images:
if: ${{ github.repository == 'I-TECH-UW/OpenELIS-Global-2' }}
runs-on: ubuntu-latest
needs:
- build-and-push-image-frontend-dev
Expand Down
2 changes: 2 additions & 0 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = defineConfig({
defaultCommandTimeout: 8000,
viewportWidth: 1200,
viewportHeight: 700,
video: false,
watchForFileChanges: false,
e2e: {
setupNodeEvents(on, config) {
Expand All @@ -21,6 +22,7 @@ module.exports = defineConfig({
"cypress/e2e/batchOrderEntry.cy.js",
"cypress/e2e/dashboard.cy.js",
"cypress/e2e/labNumberManagement.cy.js",
"cypress/e2e/AdminE2E/MenuConfig/globalMenuConfig.cy.js",
];
return config;
},
Expand Down
56 changes: 56 additions & 0 deletions frontend/cypress/e2e/AdminE2E/MenuConfig/globalMenuConfig.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import LoginPage from "../../../pages/LoginPage";

let loginPage = null;
let homePage = null;
let adminPage = null;
let globalMenuConfigPage = null;

before(() => {
// Initialize LoginPage object and navigate to Admin Page
loginPage = new LoginPage();
loginPage.visit();

homePage = loginPage.goToHomePage();
adminPage = homePage.goToAdminPage();
});

describe("Global Menu Configuration", function () {
it("User navigates to the Global Menu Configuration page", function () {
globalMenuConfigPage = adminPage.goToGlobalMenuConfigPage();
});

it("User turns 0ff the toggle switch and submits", function () {
globalMenuConfigPage.turnOffToggleSwitch();
globalMenuConfigPage.submitButton();
});

it("User turns on the toggle switch", function () {
globalMenuConfigPage.turnOnToggleSwitch();
});
it("User checks the menu items and submits", function () {
globalMenuConfigPage.checkMenuItem("home");
globalMenuConfigPage.checkMenuItem("order");
globalMenuConfigPage.checkMenuItem("billing");
globalMenuConfigPage.checkMenuItem("immunoChem");
globalMenuConfigPage.checkMenuItem("cytology");
globalMenuConfigPage.checkMenuItem("results");
globalMenuConfigPage.checkMenuItem("validation");
globalMenuConfigPage.checkMenuItem("patient");
globalMenuConfigPage.checkMenuItem("pathology");
globalMenuConfigPage.checkMenuItem("workplan");
globalMenuConfigPage.checkMenuItem("nonConform");
globalMenuConfigPage.checkMenuItem("reports");
globalMenuConfigPage.checkMenuItem("study");
globalMenuConfigPage.checkMenuItem("admin");
globalMenuConfigPage.checkMenuItem("help");
globalMenuConfigPage.submitButton();
});
it("User relogs in to verify the menu changes", function () {
// Initialize LoginPage object and navigate to the menu
loginPage = new LoginPage();
loginPage.visit();

homePage = loginPage.goToHomePage();
globalMenuConfigPage = homePage.openNavigationMenu();
});
});
34 changes: 21 additions & 13 deletions frontend/cypress/pages/AdminPage.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
//This handles all pages of the admin
import LabNumberManagementPage from "./LabNumberManagementPage";
import GlobalMenuConfigPage from "./GlobalMenuConfigPage";

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
.should("be.visible")
.click();

cy.url().should("include", "#labNumber");
cy.contains("Lab Number Management").should("be.visible");

return new LabNumberManagementPage();
}

//global menu configuration
goToGlobalMenuConfigPage() {
// Expand the dropdown by clicking the button with the expanded state
cy.contains("span", "Menu Configuration").click();
cy.get("ul.cds--side-nav__menu").should("be.visible"); // Ensure the dropdown menu is visible
// Click the link for "Global Menu Configuration"
cy.get('a.cds--side-nav__link[href="#globalMenuManagement"]').click(); // Click the "Global Menu Configuration" link

// 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
// Verify the URL and the visibility of the content
cy.url().should("include", "#globalMenuManagement");
cy.contains("Global Menu Management").should("be.visible");

return new LabNumberManagementPage(); // Return the page object
return new GlobalMenuConfigPage();
}
}

Expand Down
54 changes: 54 additions & 0 deletions frontend/cypress/pages/GlobalMenuConfigPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
class GlobalMenuConfigPage {
constructor() {}

// This method is used to visit the page
visit() {
cy.visit("/administration#globalMenuManagement");
}

turnOffToggleSwitch() {
cy.get("div.cds--toggle__switch").click();
}

turnOnToggleSwitch() {
cy.get("div.cds--toggle label div > div").should("be.visible").click();
}

checkMenuItem = function (menuItem) {
// Map of menu items to their respective checkboxes
const menuItems = {
home: "#menu_home_checkbox",
order: "#menu_sample_checkbox",
immunoChem: "#menu_immunochem_checkbox",
cytology: "#menu_cytology_checkbox",
results: "#menu_results_checkbox",
validation: "#menu_resultvalidation_checkbox",
reports: "#menu_reports_checkbox",
study: "#menu_reports_study_checkbox",
billing: "#menu_billing_checkbox",
admin: "#menu_administration_checkbox",
help: "#menu_help_checkbox",
patient: "#menu_patient_checkbox",
nonConform: "#menu_nonconformity_checkbox",
workplan: "#menu_workplan_checkbox",
pathology: "#menu_pathology_checkbox",
};

// Get the corresponding checkbox selector based on the passed menuItem
const checkboxSelector = menuItems[menuItem];

if (checkboxSelector) {
// Perform the check action, forcing it to check even if covered
cy.get(checkboxSelector).check({ force: true });
} else {
// If no valid menuItem is passed, log an error
cy.log("Invalid menu item");
}
};

submitButton() {
cy.contains("button", "Submit").click();
}
}

export default GlobalMenuConfigPage;
7 changes: 3 additions & 4 deletions frontend/cypress/pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,20 @@ class HomePage {

goToPathologyDashboard() {
this.openNavigationMenu();
cy.get("#menu_pathology_dropdown").click();
cy.get("#menu_pathologydashboard_nav").click();
cy.get("#menu_pathology").click(); // Changed from menu_pathology_dropdown
return new DashBoardPage();
}

goToImmunoChemistryDashboard() {
this.openNavigationMenu();
cy.get("#menu_immunochem_dropdown").click();
cy.get("#menu_immunochemdashboard_nav").click();
cy.get("#menu_immunochem").click(); // Changed from menu_immunochem_dropdown
return new DashBoardPage();
}

goToAdminPage() {
this.openNavigationMenu();
cy.get("#menu_administration").click();
//cy.get("#menu_administration_nav").click();
return new AdminPage();
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ li.clickableUserDetails:hover {
}

.adminPageContent {
margin-left: 21%;
margin-left: 18%;
margin-right: 1%;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,6 @@ function ConfigMenuDisplay(props) {
{rows.map((row) => (
<TableRow
key={row.id}
onClick={() => {
setSelectedRowId(row.id);
}}
>
{row.cells.map((cell) =>
renderCell(cell, row),
Expand Down
Loading

0 comments on commit aa19fab

Please sign in to comment.