diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/AdditionalComponentsScreenshotTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/AdditionalComponentsScreenshotTest.java index 02b81c32cbd..f1297ecee23 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/AdditionalComponentsScreenshotTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/AdditionalComponentsScreenshotTest.java @@ -40,9 +40,10 @@ public void captureScreenshotGrowlMessage() throws IOException { updatePortalSetting(Variable.DISPLAY_MESSAGE_AFTER_FINISH_TASK.getKey(), "true"); redirectToRelativeLink(createTestingCaseContainOneTask); ScreenshotUtils.resizeBrowser(new Dimension(1500, 1500)); - + redirectToNewDashBoard(); NewDashboardPage newDashboardPage = new NewDashboardPage(); - WaitHelper.waitForNavigation(() -> new NewDashboardPage().startTask(0)); + newDashboardPage.waitForTaskWidgetLoaded(); + newDashboardPage.startTask(0); ScreenshotUtils.resizeBrowser(new Dimension(1366, 800)); newDashboardPage = new NewDashboardPage(); newDashboardPage.waitForGrowlMessageDisplayClearly(); @@ -53,6 +54,7 @@ public void captureScreenshotGrowlMessage() throws IOException { redirectToRelativeLink(cleanupDataLink); updatePortalSetting(Variable.DISPLAY_MESSAGE_AFTER_FINISH_TASK.getKey(), "true"); redirectToRelativeLink(createTestingTasksUrl); + newDashboardPage = new NewDashboardPage(); WaitHelper.waitForNavigation(() -> new NewDashboardPage().startTask(1)); TaskTemplatePage taskTemplatePage = new TaskTemplatePage(); taskTemplatePage.switchToIFrameOfTask(); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DashboardScreenshotTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DashboardScreenshotTest.java index bdd8fc0b44f..1d1ddc9ad6c 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DashboardScreenshotTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DashboardScreenshotTest.java @@ -579,13 +579,11 @@ public void screenshotActionWarningDialogWhenStartTask() throws IOException { taskWidget.filterTaskName(taskName, FilterOperator.IS); taskWidget.applyFilter(); - newDashboardPage = new NewDashboardPage(); newDashboardPage.startTask(0); TaskTemplatePage taskIframePage = new TaskTemplatePage(); taskIframePage.switchToIFrameOfTask(); taskIframePage.clickCancelAndLeftButton(); - taskIframePage.switchBackToParent(); - + newDashboardPage = new NewDashboardPage(); newDashboardPage.waitForTaskWidgetLoaded(); newDashboardPage.startTask(0); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DemoProcessesScreenshotTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DemoProcessesScreenshotTest.java index 235a02bf8f7..ba37bd81b07 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DemoProcessesScreenshotTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/DemoProcessesScreenshotTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test; import org.openqa.selenium.Dimension; +import com.axonivy.ivy.webtest.IvyWebTest; import com.axonivy.portal.selenium.common.NavigationHelper; import com.axonivy.portal.selenium.common.ScreenshotBaseTest; import com.axonivy.portal.selenium.common.ScreenshotUtils; @@ -18,6 +19,7 @@ import com.axonivy.portal.selenium.page.NewDashboardPage; import com.axonivy.portal.selenium.page.TopMenuTaskWidgetPage; +@IvyWebTest public class DemoProcessesScreenshotTest extends ScreenshotBaseTest { private static String LEAVE_REQUEST_START_LINK = "portal-user-examples/170321BD7F5539D6/start.ivp"; diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/PortalCasesScreenshotTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/PortalCasesScreenshotTest.java index ffd8a3412be..2ebf4929d47 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/PortalCasesScreenshotTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/PortalCasesScreenshotTest.java @@ -84,6 +84,9 @@ public void screenshotCaseDetails() throws IOException { ScreenshotUtils.captureElementWithMarginOptionScreenshot(detailsPage.openAddAttachmentDialog(), ScreenshotUtils.CASE_DETAIL_FOLDER + "how-to-attach-document-to-case", new ScreenshotMargin(10)); detailsPage.closeAddAttachmentDialog(); + + refreshPage(); + detailsPage.waitForCaseDetailsDisplay(); detailsPage.uploadDocumentWithoutError(FileHelper.getAbsolutePathToTestFile("test-no-files-no-js.pdf")); refreshPage(); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseMapPage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseMapPage.java index 8beb5f7524d..3bfd0196270 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseMapPage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/CaseMapPage.java @@ -10,6 +10,7 @@ public class CaseMapPage extends TaskTemplatePage { + @Override public void waitForIFrameContentVisible() { $("button[id='form:submit-request']").shouldBe(Condition.appear, DEFAULT_TIMEOUT); } @@ -22,7 +23,7 @@ public void clickSubmitRequestButton() { public void clickSubmitButtonAndBackToTaskList() { $("button[id$='submit-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click(); - switchBackToParent(); + switchToDefaultContent(); } public String getHeader() { @@ -85,6 +86,7 @@ public SelenideElement getInternalCreditComment() { return findElementByCssSelector("textarea[id$='internal-comment']"); } + @Override public void inputField(String id, String value) { $(By.id(id)).clear(); $(By.id(id)).sendKeys(value); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskTemplatePage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskTemplatePage.java index b5b1443f124..6c7b23fd4e4 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskTemplatePage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskTemplatePage.java @@ -67,6 +67,7 @@ public SelenideElement getElementInPortalIFramTask(String cssSelector) { public void clickCancelButton() { $("a[id$='button-cancel']").shouldBe(getClickableCondition()).click(); + switchToDefaultContent(); } public void clickActionButton() { @@ -251,7 +252,8 @@ public void clickCreateGroupChatBtn() { } public void clickCancelAndLeftButton() { - waitForElementClickableThenClick("a[id$='button-cancel']"); + clickByJavaScript($(By.linkText("Cancel"))); + switchBackToParent(); } public int countSideSteps() { diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskDetailsTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskDetailsTest.java index 7e04c01af72..4d6f1a0c9a2 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskDetailsTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskDetailsTest.java @@ -145,6 +145,7 @@ public void testShowTaskStatusBannerOnTaskDetails() { taskWidget.startTask(0); redirectToNewDashBoard(); NavigationHelper.navigateToTaskList(); + taskWidget = new TopMenuTaskWidgetPage(); taskWidget.openFilterWidget(); taskWidget.removeFilter(0); taskWidget.applyFilter(); diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java index 118525d4ef8..145af647396 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java @@ -205,18 +205,6 @@ public IvyTaskResultDTO analyzeTaskCategoryStatistic(TaskSearchCriteria criteria }); } -// private TaskCategoryStatistic createTaskCategoryStatistic(Recordset recordSet) { -// TaskCategoryStatistic taskCategoryStatistic = new TaskCategoryStatistic(); -// taskCategoryStatistic.setNumberOfTasksByCategory(new HashMap<>()); -// if (recordSet != null) { -// recordSet.getRecords().forEach(record -> { -// long numberOfTasks = ((Number)(record.getField("COUNT"))).longValue(); -// taskCategoryStatistic.getNumberOfTasksByCategory().put(record.getField("CATEGORY").toString(), numberOfTasks); -// }); -// } -// return taskCategoryStatistic; -// } - private ExpiryStatistic createExpiryTimeStampToCountMap(Recordset recordSet) throws ParseException { ExpiryStatistic expiryStatistic = new ExpiryStatistic(); Map numberOfTasksByExpiryTime = new HashMap<>();