diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseEditWidgetNewDashBoardPage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseEditWidgetNewDashBoardPage.java index 240f8b4b48b..0ac3272b52e 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseEditWidgetNewDashBoardPage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseEditWidgetNewDashBoardPage.java @@ -424,4 +424,16 @@ public void resizeColumn() { .clickAndHold(element) .perform(); } + + public void clickOnCaseNameColumn() { + $("div[id$='case-widget-preview:dashboard-cases']").shouldBe(appear, DEFAULT_TIMEOUT) + .$("th[id$='dashboard-cases-columns:1']").shouldBe(getClickableCondition()).click(); + } + + public SelenideElement getFirstCaseOfCaseWidget() { + $("div[id$='case-widget-preview:dashboard-cases']").shouldBe(appear, DEFAULT_TIMEOUT).$$("table tbody tr").get(0).shouldBe(appear, + DEFAULT_TIMEOUT); + return $("div[id$='case-widget-preview:dashboard-cases']").$$("table tbody tr").get(0); + } + } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskEditWidgetNewDashBoardPage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskEditWidgetNewDashBoardPage.java index f0c8a6497d8..efd88f36f55 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskEditWidgetNewDashBoardPage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskEditWidgetNewDashBoardPage.java @@ -478,4 +478,21 @@ public SelenideElement getExpandModeCheckbox() { public void clickOnExpandModeCheckbox() { getExpandModeCheckbox().shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click(); } + + public void clickOnTaskNameColumn() { + $("div[id$='task-widget-preview:dashboard-tasks']").shouldBe(appear, DEFAULT_TIMEOUT) + .$("th[id$='dashboard-tasks-columns:3']").shouldBe(getClickableCondition()).click(); + } + + public void clickOnTaskPriorityColumn() { + $("div[id$='task-widget-preview:dashboard-tasks']").shouldBe(appear, DEFAULT_TIMEOUT) + .$("th[id$='dashboard-tasks-columns:1']").shouldBe(getClickableCondition()).click(); + } + + public SelenideElement getFirstTaskOfTaskWidget() { + $("div[id$='task-widget-preview:dashboard-tasks']").shouldBe(appear, DEFAULT_TIMEOUT).$$("table tbody tr").get(0).shouldBe(appear, + DEFAULT_TIMEOUT); + return $("div[id$='task-widget-preview:dashboard-tasks']").$$("table tbody tr").get(0); + } + } \ No newline at end of file diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditCaseWidgetTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditCaseWidgetTest.java index bc6f4702b75..3d55583f38e 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditCaseWidgetTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditCaseWidgetTest.java @@ -1,5 +1,7 @@ package com.axonivy.portal.selenium.test.dashboard; +import static com.codeborne.selenide.Condition.text; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.Dimension; @@ -12,6 +14,7 @@ import com.axonivy.portal.selenium.common.ScreenshotUtils; import com.axonivy.portal.selenium.common.TestAccount; import com.axonivy.portal.selenium.page.CaseEditWidgetNewDashBoardPage; +import com.axonivy.portal.selenium.page.CaseWidgetNewDashBoardPage; import com.axonivy.portal.selenium.page.DashboardConfigurationPage; import com.axonivy.portal.selenium.page.NewDashboardDetailsEditPage; import com.codeborne.selenide.CollectionCondition; @@ -19,6 +22,10 @@ @IvyWebTest public class DashboardEditCaseWidgetTest extends BaseTest { private static final String NAME_STR = "Name"; + private static final String YOUR_CASES_WIDGET = "Your Cases"; + + private static final String ALPHA_COMPANY = "Alpha Company"; + private static final String ORDER_PIZZA = " Order Pizza"; @Override @BeforeEach @@ -201,4 +208,24 @@ private NewDashboardDetailsEditPage gotoEditPublicDashboardPage() { return modificationPage.navigateToEditDashboardDetailsByName("Dashboard"); } + @Test + public void testDefaultSortOnCaseWidget() { + redirectToRelativeLink(createCaseWithTechnicalCaseUrl); + redirectToRelativeLink(createAlphaCompanyUrl); + + LinkNavigator.redirectToPortalDashboardConfiguration(); + var configurationPage = new DashboardConfigurationPage(); + var modificationPage = configurationPage.openEditPublicDashboardsPage(); + modificationPage.navigateToEditDashboardDetailsByName("Dashboard"); + + CaseWidgetNewDashBoardPage caseWidget = new CaseWidgetNewDashBoardPage(YOUR_CASES_WIDGET); + CaseEditWidgetNewDashBoardPage caseEditWidgetPage = caseWidget.openEditWidget(); + + caseEditWidgetPage.clickOnCaseNameColumn(); + caseEditWidgetPage.getFirstCaseOfCaseWidget().shouldHave(text(ALPHA_COMPANY), DEFAULT_TIMEOUT);; + + caseEditWidgetPage.clickOnCaseNameColumn(); + caseEditWidgetPage.getFirstCaseOfCaseWidget().shouldHave(text(ORDER_PIZZA), DEFAULT_TIMEOUT);; + + } } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditTaskWidgetTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditTaskWidgetTest.java index bf56c48e4ae..1fffa4e4867 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditTaskWidgetTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardEditTaskWidgetTest.java @@ -1,5 +1,7 @@ package com.axonivy.portal.selenium.test.dashboard; +import static com.codeborne.selenide.Condition.text; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -12,10 +14,15 @@ import com.axonivy.portal.selenium.page.DashboardConfigurationPage; import com.axonivy.portal.selenium.page.NewDashboardDetailsEditPage; import com.axonivy.portal.selenium.page.TaskEditWidgetNewDashBoardPage; +import com.axonivy.portal.selenium.page.TaskWidgetNewDashBoardPage; import com.codeborne.selenide.CollectionCondition; @IvyWebTest public class DashboardEditTaskWidgetTest extends BaseTest { + private static final String YOUR_TASKS_WIDGET = "Your Tasks"; + private static final String MATERNITY_LEAVE_REQUEST = "Maternity Leave Request"; + private static final String SICK_LEAVE_REQUEST = "Sick Leave Request"; + private NewDashboardDetailsEditPage newDashboardDetailsEditPage; @Override @@ -165,4 +172,26 @@ public void testFilterResponsible() { taskWidget.applyFilter(); taskWidget.countAllTasks().shouldHave(CollectionCondition.size(0)); } + + @Test + public void testDefaultSortOnTaskWidget() { + LinkNavigator.redirectToPortalDashboardConfiguration(); + var configurationPage = new DashboardConfigurationPage(); + var modificationPage = configurationPage.openEditPublicDashboardsPage(); + modificationPage.navigateToEditDashboardDetailsByName("Dashboard"); + + TaskWidgetNewDashBoardPage taskWidget = new TaskWidgetNewDashBoardPage(YOUR_TASKS_WIDGET); + TaskEditWidgetNewDashBoardPage taskEditWidgetPage = taskWidget.openEditTaskWidget(); + + // sort by task priority + taskEditWidgetPage.clickOnTaskPriorityColumn(); + taskEditWidgetPage.getFirstTaskOfTaskWidget(); + taskEditWidgetPage.getFirstTaskOfTaskWidget().shouldHave(text(SICK_LEAVE_REQUEST), DEFAULT_TIMEOUT); + + // sort by task name + taskEditWidgetPage.clickOnTaskNameColumn(); + taskEditWidgetPage.getFirstTaskOfTaskWidget(); + taskEditWidgetPage.getFirstTaskOfTaskWidget().shouldHave(text(MATERNITY_LEAVE_REQUEST), DEFAULT_TIMEOUT); + + } } diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml index a955c99272a..6d37265bc9f 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml @@ -52,7 +52,7 @@ - + diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml index d3ed08f9797..ea674839278 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml @@ -23,7 +23,7 @@ - @@ -52,7 +52,7 @@ + diff --git a/build/document-screenshot-selenide/Jenkinsfile b/build/document-screenshot-selenide/Jenkinsfile index 7d77ac2d8b7..d7fe1b67782 100644 --- a/build/document-screenshot-selenide/Jenkinsfile +++ b/build/document-screenshot-selenide/Jenkinsfile @@ -1,14 +1,10 @@ pipeline { - agent {label 'portal-slave'} + agent {label 'vu-pc'} options { buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '60')) } - triggers { - cron('0 15 * * *') - } - tools { maven '3.9' jdk '21' diff --git a/build/gui-test-new-dashboard/Jenkinsfile b/build/gui-test-new-dashboard/Jenkinsfile index 8ce96f24e30..c3f00b47e9c 100644 --- a/build/gui-test-new-dashboard/Jenkinsfile +++ b/build/gui-test-new-dashboard/Jenkinsfile @@ -1,15 +1,10 @@ pipeline { - agent {label 'portal-slave'} + agent {label 'vu-pc'} options { buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '60')) } - triggers { - pollSCM '0 7 * * *' - cron('0 11 * * *') - } - tools { maven '3.9' jdk '21'