From 3508c1ac24c144f709409fc4f34c4892247a39f5 Mon Sep 17 00:00:00 2001 From: Brian308 Date: Wed, 22 Jan 2025 13:22:05 +0300 Subject: [PATCH 1/6] Updated the dashboard E2E --- frontend/cypress.config.js | 3 +- frontend/cypress/e2e/dashboard.cy.js | 86 ++++++++++------------------ frontend/cypress/fixtures/Order.json | 17 ++---- frontend/cypress/pages/DashBoard.js | 80 +++++--------------------- frontend/cypress/pages/HomePage.js | 8 ++- 5 files changed, 57 insertions(+), 137 deletions(-) diff --git a/frontend/cypress.config.js b/frontend/cypress.config.js index f8c3f9b81c..c1feed3bb2 100755 --- a/frontend/cypress.config.js +++ b/frontend/cypress.config.js @@ -1,7 +1,8 @@ const { defineConfig } = require("cypress"); module.exports = defineConfig({ - defaultCommandTimeout: 8000, + //increased the timeout from 8000 to 80000 + defaultCommandTimeout: 80000, viewportWidth: 1200, viewportHeight: 700, watchForFileChanges: false, diff --git a/frontend/cypress/e2e/dashboard.cy.js b/frontend/cypress/e2e/dashboard.cy.js index 9612f2b30a..5f1ebf3257 100644 --- a/frontend/cypress/e2e/dashboard.cy.js +++ b/frontend/cypress/e2e/dashboard.cy.js @@ -7,79 +7,53 @@ let dashboard = null; before("login", () => { loginPage = new LoginPage(); loginPage.visit(); -}); -describe("Pathology Dashboard", function () { - it("User Visits Pathology Dashboard", function () { - homePage = loginPage.goToHomePage(); - dashboard = homePage.goToPathologyDashboard(); + homePage = loginPage.goToHomePage(); - dashboard.checkForHeader("Pathology"); - }); - - it("User adds a new Pathology order", function () { - homePage.goToOrderPage(); - dashboard.addOrder("Histopathology"); - }); - it("Check For Order", () => { - homePage.goToPathologyDashboard(); - dashboard.checkForHeader("Pathology"); - - cy.fixture("DashBoard").then((order) => { - dashboard.validatePreStatus(order.labNo); - }); - }); + cy.fixture("Order").as("dashBData"); +}); - it("Change The Status of Order and save it", () => { - dashboard.changeStatus("Completed"); - dashboard.enterDetails(); - dashboard.saveOrder(); +describe("Pathology Dashboard", function () { + it("User Visits the Dashboard", function () { + dashboard = homePage.goToPathology(); }); - it("Validate the Status of Order", () => { - cy.fixture("DashBoard").then((order) => { - // dashboard.validateOrderStatus(order.labNo, 4); + it("User checks filters, selects cases and items per page", function () { + dashboard.checkFilters(); + cy.fixture("Order").then((dashBData) => { + dashboard.selectCases(dashBData.myCases); + dashboard.enterLabNumber(dashBData.labNo); + dashboard.pageItems(dashBData.itemsPerPage); }); }); }); -describe("ImmunoChemistry Dashboard", function () { - it("User Visits ImmunoChemistry Dashboard", function () { - homePage = loginPage.goToHomePage(); +describe("Immunohistochemistry Dashboard", function () { + it("User Visits the Dashboard", function () { dashboard = homePage.goToImmunoChemistryDashboard(); - dashboard.checkForHeader("Immunohistochemistry"); - - // cy.fixture("DashBoard").then((order) => { - // dashboard.validatePreStatus(order.labNo); - - // }); - }); - - it("User adds a new ImmunioChemistry order", function () { - homePage.goToOrderPage(); - dashboard.addOrder("Immunohistochemistry"); }); - it("Check For Order", () => { - homePage.goToImmunoChemistryDashboard(); - - dashboard.checkForHeader("Immunohistochemistry"); - - cy.fixture("DashBoard").then((order) => { - dashboard.validatePreStatus(order.labNo); + it("User checks filters, selects cases and items per page", function () { + dashboard.checkFilters(); + cy.fixture("Order").then((dashBData) => { + dashboard.selectCompletedCases(dashBData.myCases2); + dashboard.enterLabNumber(dashBData.labNo); + dashboard.pageItems(dashBData.itemsPerPage); }); }); +}); - it("Change The Status of Order and save it", () => { - dashboard.changeStatus("Completed"); - dashboard.selectPathologist("ELIS,Open"); - dashboard.saveOrder(); +describe("Cytology Dashboard", function () { + it("User Visits the Dashboard", function () { + dashboard = homePage.goToCytology(); }); - it("Validate the Status of Order", () => { - cy.fixture("DashBoard").then((order) => { - //TO DO : needs to be properly re-writen with proper selector - //dashboard.validateOrderStatus(order.labNo, 3); + it("User checks filters, selects cases and items per page", function () { + dashboard.checkFilters(); + cy.fixture("Order").then((dashBData) => { + dashboard.selectScreeningCases(dashBData.myCases3); + dashboard.enterLabNumber(dashBData.labNo); + dashboard.pageItems(dashBData.itemsPerPage); }); }); }); diff --git a/frontend/cypress/fixtures/Order.json b/frontend/cypress/fixtures/Order.json index 05213a9d4e..9fd0006482 100644 --- a/frontend/cypress/fixtures/Order.json +++ b/frontend/cypress/fixtures/Order.json @@ -1,14 +1,7 @@ { - "samples": [ - { - "sampleType": "Serum" - } - ], - "siteName": "279 - CAMES MAN", - "requester": { - "firstName": "Optimus", - "lastName": "Prime" - }, - "labNo": "", - "invalidLabNo": "DEV0124000000000000" + "labNo": "REG-00000123", + "myCases": "Grossing", + "myCases2": "Completed", + "myCases3": "Screening", + "itemsPerPage": "30" } diff --git a/frontend/cypress/pages/DashBoard.js b/frontend/cypress/pages/DashBoard.js index 4ebee5f489..ab89db7868 100644 --- a/frontend/cypress/pages/DashBoard.js +++ b/frontend/cypress/pages/DashBoard.js @@ -1,81 +1,27 @@ class DashBoardPage { - addOrder(Program) { - cy.fixture("Order").then((order) => { - cy.get( - ":nth-child(2) > .cds--radio-button__label > .cds--radio-button__appearance", - ).click(); - cy.get("#local_search").click(); - cy.get( - "tbody > :nth-child(1) > :nth-child(1) > .cds--radio-button-wrapper > .cds--radio-button__label > .cds--radio-button__appearance", - ).click(); - cy.get(".forwardButton").click(); - cy.get("#additionalQuestionsSelect").select(Program); - cy.get(".forwardButton").click(); - cy.get("#sampleId_0").select("Serum"); - cy.get( - ".testPanels > .cds--col > :nth-child(5) > .cds--checkbox-label", - ).click(); - cy.get(".forwardButton").click(); - cy.get( - ":nth-child(2) > :nth-child(1) > :nth-child(2) > .cds--link", - ).click(); - cy.wait(1000); + constructor() {} - cy.get("#labNo") - .invoke("val") - .then((labNoValue) => { - if (labNoValue) { - const data = { labNo: labNoValue }; - cy.writeFile("cypress/fixtures/DashBoard.json", data); - } else { - cy.log("labNoValue is empty or undefined"); - } - }); - - cy.get("#siteName").type(order.siteName); - cy.get("#requesterFirstName").type(order.requester.firstName); - cy.get("#requesterLastName").type(order.requester.firstName); - cy.get(".forwardButton").should("be.visible").click(); - }); - } - - checkForHeader(title) { - cy.get("section > h3").should("have.text", title); + checkFilters() { + cy.get("#filterMyCases").check({ force: true }); } - enterDetails() { - cy.get( - ":nth-child(14) > .gridBoundary > :nth-child(1) > .cds--form-item > .cds--text-area__wrapper > .cds--text-area", - ).type("Test"); - cy.get( - ":nth-child(2) > .cds--form-item > .cds--text-area__wrapper > .cds--text-area", - ).type("Test"); + selectCases(myCases) { + cy.get("#statusFilter").select(myCases); } - validateOrderStatus(orderNumber, childIndex) { - cy.get(":nth-child(2) > .cds--link").click(); - cy.get(":nth-child(1) > .tile-value").should("have.text", "0"); - cy.get(`:nth-child(${childIndex}) > .tile-value`).should("have.text", "1"); - cy.get("#statusFilter").select("Completed"); - cy.get("tbody > tr > :nth-child(4)").should("have.text", "John"); + selectCompletedCases(myCases2) { + cy.get("#statusFilter").select(myCases2); } - validatePreStatus(order) { - cy.get(":nth-child(1) > .tile-value").should("have.text", "1"); - cy.get("tbody > tr > :nth-child(4)").should("have.text", "John"); - cy.get("tbody > tr > :nth-child(6)").click(); + selectScreeningCases(myCases3) { + cy.get("#statusFilter").select(myCases3); } - - saveOrder() { - cy.get("#pathology_save2").click(); - } - - changeStatus(status) { - cy.get("#status").select(status); + enterLabNumber(labNo) { + cy.get("#search-input-41").should('be.visible').type(labNo); } - selectPathologist(pathologist) { - cy.get("#assignedPathologist").select(pathologist); + pageItems(itemsPerPage) { + cy.get("#cds-pagination-select-id-59").select(itemsPerPage); } } diff --git a/frontend/cypress/pages/HomePage.js b/frontend/cypress/pages/HomePage.js index 44aeccb960..4ee5d20c49 100755 --- a/frontend/cypress/pages/HomePage.js +++ b/frontend/cypress/pages/HomePage.js @@ -180,7 +180,7 @@ class HomePage { return new StudyReportPage(); } - goToPathologyDashboard() { + goToPathology() { this.openNavigationMenu(); cy.get("#menu_pathology").click(); // Changed from menu_pathology_dropdown return new DashBoardPage(); @@ -192,6 +192,12 @@ class HomePage { return new DashBoardPage(); } + goToCytology() { + this.openNavigationMenu(); + cy.get("#menu_cytology").click(); + return new DashBoardPage(); + } + goToAdminPage() { this.openNavigationMenu(); cy.get("#menu_administration").click(); From 84cadb6027a72728f94a786ddccd1165db598cfc Mon Sep 17 00:00:00 2001 From: Brian308 Date: Wed, 22 Jan 2025 13:26:57 +0300 Subject: [PATCH 2/6] Updated the dashboard E2E --- frontend/cypress/pages/DashBoard.js | 2 +- .../admin/generalConfig/common/ConfigMenuDisplay.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/pages/DashBoard.js b/frontend/cypress/pages/DashBoard.js index ab89db7868..0dfae276fd 100644 --- a/frontend/cypress/pages/DashBoard.js +++ b/frontend/cypress/pages/DashBoard.js @@ -17,7 +17,7 @@ class DashBoardPage { cy.get("#statusFilter").select(myCases3); } enterLabNumber(labNo) { - cy.get("#search-input-41").should('be.visible').type(labNo); + cy.get("#search-input-41").should("be.visible").type(labNo); } pageItems(itemsPerPage) { diff --git a/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js b/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js index 9356548cce..c484662495 100644 --- a/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js +++ b/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js @@ -269,9 +269,7 @@ function ConfigMenuDisplay(props) { <> {rows.map((row) => ( - + {row.cells.map((cell) => renderCell(cell, row), )} From 625a3a32242918ec904f1d5c8e1e33d9af6a342a Mon Sep 17 00:00:00 2001 From: Brian308 Date: Wed, 22 Jan 2025 13:26:57 +0300 Subject: [PATCH 3/6] Updated the dashboard E2E --- frontend/cypress/pages/DashBoard.js | 2 +- .../admin/generalConfig/common/ConfigMenuDisplay.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/cypress/pages/DashBoard.js b/frontend/cypress/pages/DashBoard.js index ab89db7868..0dfae276fd 100644 --- a/frontend/cypress/pages/DashBoard.js +++ b/frontend/cypress/pages/DashBoard.js @@ -17,7 +17,7 @@ class DashBoardPage { cy.get("#statusFilter").select(myCases3); } enterLabNumber(labNo) { - cy.get("#search-input-41").should('be.visible').type(labNo); + cy.get("#search-input-41").should("be.visible").type(labNo); } pageItems(itemsPerPage) { diff --git a/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js b/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js index 9356548cce..c484662495 100644 --- a/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js +++ b/frontend/src/components/admin/generalConfig/common/ConfigMenuDisplay.js @@ -269,9 +269,7 @@ function ConfigMenuDisplay(props) { <> {rows.map((row) => ( - + {row.cells.map((cell) => renderCell(cell, row), )} From bffed42162864fb927803b671035ed6caa8b4c5a Mon Sep 17 00:00:00 2001 From: Brian308 Date: Thu, 23 Jan 2025 17:50:53 +0300 Subject: [PATCH 4/6] made some modifications --- frontend/cypress.config.js | 3 +-- frontend/cypress/e2e/dashboard.cy.js | 2 +- frontend/cypress/fixtures/Order.json | 14 +++++++++++++- frontend/cypress/pages/DashBoard.js | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/frontend/cypress.config.js b/frontend/cypress.config.js index 752e3b9dca..cc6c267c1b 100755 --- a/frontend/cypress.config.js +++ b/frontend/cypress.config.js @@ -1,8 +1,7 @@ const { defineConfig } = require("cypress"); module.exports = defineConfig({ - //increased the timeout from 8000 to 80000 - defaultCommandTimeout: 80000, + defaultCommandTimeout: 8000, viewportWidth: 1200, viewportHeight: 700, video: false, diff --git a/frontend/cypress/e2e/dashboard.cy.js b/frontend/cypress/e2e/dashboard.cy.js index 5f1ebf3257..9fc8d5614c 100644 --- a/frontend/cypress/e2e/dashboard.cy.js +++ b/frontend/cypress/e2e/dashboard.cy.js @@ -22,7 +22,7 @@ describe("Pathology Dashboard", function () { dashboard.checkFilters(); cy.fixture("Order").then((dashBData) => { dashboard.selectCases(dashBData.myCases); - dashboard.enterLabNumber(dashBData.labNo); + dashboard.enterLabNumber(dashBData.labNum); dashboard.pageItems(dashBData.itemsPerPage); }); }); diff --git a/frontend/cypress/fixtures/Order.json b/frontend/cypress/fixtures/Order.json index 9fd0006482..386b9303ee 100644 --- a/frontend/cypress/fixtures/Order.json +++ b/frontend/cypress/fixtures/Order.json @@ -1,5 +1,17 @@ { - "labNo": "REG-00000123", + "samples": [ + { + "sampleType": "Serum" + } + ], + "siteName": "279 - CAMES MAN", + "requester": { + "firstName": "Optimus", + "lastName": "Prime" + }, + "labNo": "", + "invalidLabNo": "DEV0124000000000000", + "labNumb": "REG-00000123", "myCases": "Grossing", "myCases2": "Completed", "myCases3": "Screening", diff --git a/frontend/cypress/pages/DashBoard.js b/frontend/cypress/pages/DashBoard.js index 0dfae276fd..41d57cfb51 100644 --- a/frontend/cypress/pages/DashBoard.js +++ b/frontend/cypress/pages/DashBoard.js @@ -16,8 +16,8 @@ class DashBoardPage { selectScreeningCases(myCases3) { cy.get("#statusFilter").select(myCases3); } - enterLabNumber(labNo) { - cy.get("#search-input-41").should("be.visible").type(labNo); + enterLabNumber(labNum) { + cy.get("#search-input-41").should("be.visible").type(labNum); } pageItems(itemsPerPage) { From 23067f3994933f40d6ea4ca40b716fcaf165be6e Mon Sep 17 00:00:00 2001 From: Brian308 Date: Sun, 26 Jan 2025 19:54:58 +0300 Subject: [PATCH 5/6] Modified dashboard --- frontend/cypress/e2e/dashboard.cy.js | 42 ++++++++++++++++++++++++--- frontend/cypress/fixtures/Order.json | 4 ++- frontend/cypress/pages/DashBoard.js | 43 ++++++++++++++++++++++++++-- frontend/cypress/pages/HomePage.js | 5 ++++ 4 files changed, 87 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/e2e/dashboard.cy.js b/frontend/cypress/e2e/dashboard.cy.js index 9fc8d5614c..94a95cf2a6 100644 --- a/frontend/cypress/e2e/dashboard.cy.js +++ b/frontend/cypress/e2e/dashboard.cy.js @@ -1,18 +1,46 @@ import LoginPage from "../pages/LoginPage"; +import DashBoardPage from "../pages/DashBoard"; let homePage = null; let loginPage = null; let dashboard = null; -before("login", () => { +before(() => { loginPage = new LoginPage(); loginPage.visit(); + dashboard = new DashBoardPage(); homePage = loginPage.goToHomePage(); cy.fixture("Order").as("dashBData"); }); +describe("Dashboard for the Home Page", function () { + it("User clicks search bar", function () { + dashboard.homeSearchBar(); + }); + + it("User types the patient to search and closes it", function () { + cy.fixture("Order").then((dashBData) => { + dashboard.searchBarInput(dashBData.searchName); + }); + dashboard.searchBarClose(); + }); + + it("User interacts with the notifications icon", function () { + dashboard.notificationIcon(); + dashboard.notificationIconClose(); + }); + + it("User interacts with the user icon", function () { + dashboard.userIcon(); + cy.fixture("Order").then((dashBData) => { + dashboard.userSelectsEng(dashBData.engLang); + }); + dashboard.userClosesIcon(); + }); +}); + describe("Pathology Dashboard", function () { it("User Visits the Dashboard", function () { dashboard = homePage.goToPathology(); @@ -22,7 +50,7 @@ describe("Pathology Dashboard", function () { dashboard.checkFilters(); cy.fixture("Order").then((dashBData) => { dashboard.selectCases(dashBData.myCases); - dashboard.enterLabNumber(dashBData.labNum); + dashboard.enterLabNumber(dashBData.labNumb); dashboard.pageItems(dashBData.itemsPerPage); }); }); @@ -37,7 +65,7 @@ describe("Immunohistochemistry Dashboard", function () { dashboard.checkFilters(); cy.fixture("Order").then((dashBData) => { dashboard.selectCompletedCases(dashBData.myCases2); - dashboard.enterLabNumber(dashBData.labNo); + dashboard.enterLabNumber(dashBData.labNumb); dashboard.pageItems(dashBData.itemsPerPage); }); }); @@ -52,8 +80,14 @@ describe("Cytology Dashboard", function () { dashboard.checkFilters(); cy.fixture("Order").then((dashBData) => { dashboard.selectScreeningCases(dashBData.myCases3); - dashboard.enterLabNumber(dashBData.labNo); + dashboard.enterLabNumber(dashBData.labNumb); dashboard.pageItems(dashBData.itemsPerPage); }); }); }); + +describe("Back to home page", function () { + it("User navigates back to home page", function () { + dashboard = homePage.backToHomePage(); + }); +}); diff --git a/frontend/cypress/fixtures/Order.json b/frontend/cypress/fixtures/Order.json index 386b9303ee..f10b1a005a 100644 --- a/frontend/cypress/fixtures/Order.json +++ b/frontend/cypress/fixtures/Order.json @@ -15,5 +15,7 @@ "myCases": "Grossing", "myCases2": "Completed", "myCases3": "Screening", - "itemsPerPage": "30" + "itemsPerPage": "30", + "searchName": "Smith", + "engLang": "English" } diff --git a/frontend/cypress/pages/DashBoard.js b/frontend/cypress/pages/DashBoard.js index 41d57cfb51..7844965eb1 100644 --- a/frontend/cypress/pages/DashBoard.js +++ b/frontend/cypress/pages/DashBoard.js @@ -1,6 +1,45 @@ class DashBoardPage { constructor() {} + homeSearchBar() { + //#tooltip-43 #mainHeader > div.cds--header__global > span:nth-child(1) > button + cy.get("#mainHeader > div.cds--header__global > span:nth-child(1)").click(); + //cy.get(".search-bar-container").should("be.visible").click(); + } + searchBarInput(inputName) { + cy.get("#searchItem").type(inputName); + } + + searchBarClose() { + cy.get("#mainHeader > div.cds--header__global > span:nth-child(2)").click(); + } + + notificationIcon() { + cy.get( + "#mainHeader > div.cds--header__global > span:nth-child(2) > button", + ).click(); + } + + notificationIconClose() { + cy.get("#close-slide-over").click(); + } + + userIcon() { + cy.get( + "#mainHeader > div.cds--header__global > span:nth-child(3) > button", + ).click(); + } + + userSelectsEng(engLang) { + cy.get("#selector").select(engLang); + } + + userClosesIcon() { + cy.get( + "#mainHeader > div.cds--header__global > span:nth-child(3) > button", + ).click(); + } + checkFilters() { cy.get("#filterMyCases").check({ force: true }); } @@ -16,8 +55,8 @@ class DashBoardPage { selectScreeningCases(myCases3) { cy.get("#statusFilter").select(myCases3); } - enterLabNumber(labNum) { - cy.get("#search-input-41").should("be.visible").type(labNum); + enterLabNumber(labNumb) { + cy.get("#search-input-41").should("be.visible").type(labNumb); } pageItems(itemsPerPage) { diff --git a/frontend/cypress/pages/HomePage.js b/frontend/cypress/pages/HomePage.js index 4ee5d20c49..0443084316 100755 --- a/frontend/cypress/pages/HomePage.js +++ b/frontend/cypress/pages/HomePage.js @@ -204,6 +204,11 @@ class HomePage { //cy.get("#menu_administration_nav").click(); return new AdminPage(); } + //This takes you from any page back to the home page + backToHomePage() { + this.openNavigationMenu(); + cy.get("#menu_home").click(); + } } export default HomePage; From c7aa5c13191e730abf4c9a85d9cd21b56a53cc5e Mon Sep 17 00:00:00 2001 From: Brian308 Date: Mon, 27 Jan 2025 00:11:08 +0300 Subject: [PATCH 6/6] Added data-cy selectors --- frontend/cypress/e2e/dashboard.cy.js | 4 ++-- frontend/cypress/pages/DashBoard.js | 18 +++++------------- frontend/src/components/layout/Header.js | 3 +++ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/frontend/cypress/e2e/dashboard.cy.js b/frontend/cypress/e2e/dashboard.cy.js index 94a95cf2a6..350b97956f 100644 --- a/frontend/cypress/e2e/dashboard.cy.js +++ b/frontend/cypress/e2e/dashboard.cy.js @@ -24,7 +24,7 @@ describe("Dashboard for the Home Page", function () { cy.fixture("Order").then((dashBData) => { dashboard.searchBarInput(dashBData.searchName); }); - dashboard.searchBarClose(); + dashboard.homeSearchBar(); }); it("User interacts with the notifications icon", function () { @@ -37,7 +37,7 @@ describe("Dashboard for the Home Page", function () { cy.fixture("Order").then((dashBData) => { dashboard.userSelectsEng(dashBData.engLang); }); - dashboard.userClosesIcon(); + dashboard.userIcon(); }); }); diff --git a/frontend/cypress/pages/DashBoard.js b/frontend/cypress/pages/DashBoard.js index 7844965eb1..a21bc8e17d 100644 --- a/frontend/cypress/pages/DashBoard.js +++ b/frontend/cypress/pages/DashBoard.js @@ -2,22 +2,18 @@ class DashBoardPage { constructor() {} homeSearchBar() { - //#tooltip-43 #mainHeader > div.cds--header__global > span:nth-child(1) > button - cy.get("#mainHeader > div.cds--header__global > span:nth-child(1)").click(); - //cy.get(".search-bar-container").should("be.visible").click(); + cy.get('[data-cy="header-global-action-search"]').click(); } searchBarInput(inputName) { cy.get("#searchItem").type(inputName); } searchBarClose() { - cy.get("#mainHeader > div.cds--header__global > span:nth-child(2)").click(); + cy.get('[data-cy="header-global-action-search"]').click(); } notificationIcon() { - cy.get( - "#mainHeader > div.cds--header__global > span:nth-child(2) > button", - ).click(); + cy.get('[data-cy="header-global-action-notifications"]').click(); } notificationIconClose() { @@ -25,9 +21,7 @@ class DashBoardPage { } userIcon() { - cy.get( - "#mainHeader > div.cds--header__global > span:nth-child(3) > button", - ).click(); + cy.get('[data-cy="header-global-action-user"]').click(); } userSelectsEng(engLang) { @@ -35,9 +29,7 @@ class DashBoardPage { } userClosesIcon() { - cy.get( - "#mainHeader > div.cds--header__global > span:nth-child(3) > button", - ).click(); + cy.get('[data-cy="header-global-action-user"]').click(); } checkFilters() { diff --git a/frontend/src/components/layout/Header.js b/frontend/src/components/layout/Header.js index a345dc8f43..8fb0a8c556 100644 --- a/frontend/src/components/layout/Header.js +++ b/frontend/src/components/layout/Header.js @@ -452,6 +452,7 @@ function OEHeader(props) { {!searchBar ? ( @@ -462,6 +463,7 @@ function OEHeader(props) {
{panelSwitchIcon()}