diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/MainMenuPage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/MainMenuPage.java index 1393d917e0..2873270d8a 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/MainMenuPage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/MainMenuPage.java @@ -79,14 +79,6 @@ public String getMenuItemsAsString() { .map(SelenideElement::getText).collect(Collectors.toList())); } - - public TaskWidgetNewDashBoardPage clickTaskMenu() { - $(By.id("left-menu")).shouldBe(appear, DEFAULT_TIMEOUT).hover().scrollTo(); - WaitHelper.waitForNavigation(() -> $(By.cssSelector("li[id$='default-task-list-dashboard-main-dashboard']")) - .shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click()); - return new TaskWidgetNewDashBoardPage(); - } - public CaseWidgetNewDashBoardPage selectCaseMenu() { $(By.id("left-menu")).shouldBe(appear, DEFAULT_TIMEOUT).hover().scrollTo(); WaitHelper.waitForNavigation(() -> $(By.cssSelector("li[id$='default-case-list-dashboard-main-dashboard']")) @@ -159,7 +151,14 @@ public NewDashboardPage selectDashboardMenu() { .shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click()); return new NewDashboardPage(); } - + + public TaskWidgetNewDashBoardPage selectTaskMenuItem() { + $(By.id("left-menu")).shouldBe(appear, DEFAULT_TIMEOUT).hover().scrollTo(); + WaitHelper.waitForNavigation(() -> $(By.cssSelector("li[id$='default-task-list-dashboard-main-dashboard']")) + .shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click()); + return new TaskWidgetNewDashBoardPage(); + } + public String getIconClassMainMenuEntryAsString() { return $("div[id='user-menu-required-login']").shouldBe(appear, DEFAULT_TIMEOUT) .$("li[id*='main-menu__js__DASHBOARD-parent-dashboard']").shouldBe(appear, DEFAULT_TIMEOUT) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/MenuHighlightTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/MenuHighlightTest.java index 28d44f0e9c..5449232309 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/MenuHighlightTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/MenuHighlightTest.java @@ -50,7 +50,7 @@ public void testHighlightDefaultMenus() { MainMenuPage menuPage = new MainMenuPage(); menuPage.selectProcessesMenu(); assertMenuHighlighted(MAIN_MENU_PROCESS); - menuPage.clickTaskMenu(); + menuPage.selectTaskMenuItem(); assertMenuHighlighted(DEFAULT_TASK_LIST_DASHBOARD_MAIN_DASHBOARD_PATTERN); menuPage.selectCaseMenu(); assertMenuHighlighted(DEFAULT_CASE_LIST_DASHBOARD_MAIN_DASHBOARD_PATTERN); @@ -105,7 +105,7 @@ public void tesChangingtHomepageInUserProfile() { profilePage.saveWithoutWaitingNavigation(); new CaseWidgetNewDashBoardPage(); MainMenuPage menuPage = new MainMenuPage(); - menuPage.clickTaskMenu(); + menuPage.selectTaskMenuItem(); assertMenuHighlighted(DEFAULT_TASK_LIST_DASHBOARD_MAIN_DASHBOARD_PATTERN); TopMenuTaskWidgetPage taskWidgetPage = new TopMenuTaskWidgetPage(); TaskIFrameTemplatePage taskTemplatePage = taskWidgetPage.startTaskIFrameByIndex(0); @@ -116,7 +116,7 @@ public void tesChangingtHomepageInUserProfile() { redirectToRelativeLink(createAlphaCompanyUrl); new CaseWidgetNewDashBoardPage(); assertMenuHighlighted(DEFAULT_CASE_LIST_DASHBOARD_MAIN_DASHBOARD_PATTERN); - menuPage.clickTaskMenu(); + menuPage.selectTaskMenuItem(); $("td.dashboard-tasks__state").shouldBe(Condition.text("Open")); taskWidgetPage.startTask(0); $("td.dashboard-tasks__state").shouldBe(Condition.text("Done"));