From 5db82eb5b14e2e1fdd84775a12cc7ebe891690cf Mon Sep 17 00:00:00 2001 From: Nam Mai <117440763+mnhnam-axonivy@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:02:35 +0700 Subject: [PATCH 01/18] IVYPORTAL-17855 Various or urgent requests in IVYPORTAL - S267 > IVYPORTAL-17917 Column width feature cache after edit widget height (#1173) - Fixed bug --- .../webContent/resources/css/dashboard.css | 5 +++ .../webContent/resources/css/utility.css | 11 ++++++- .../webContent/resources/js/dashboard.js | 33 ++++++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/AxonIvyPortal/portal/webContent/resources/css/dashboard.css b/AxonIvyPortal/portal/webContent/resources/css/dashboard.css index 21885da4177..ccfff416273 100644 --- a/AxonIvyPortal/portal/webContent/resources/css/dashboard.css +++ b/AxonIvyPortal/portal/webContent/resources/css/dashboard.css @@ -716,6 +716,11 @@ body .dashboard__table--edit.ui-datatable tbody tr.ui-state-hover { cursor: move; } +body .dashboard__table--edit.ui-datatable-resizable .ui-datatable-scrollable-header, +body .dashboard__table--edit.ui-datatable-resizable .ui-datatable-scrollable-footer { + background: transparent; +} + body .dashboard__table--preview.ui-datatable tbody tr.ui-state-highlight, body .dashboard__table--preview.ui-datatable tbody tr.ui-state-hover { cursor: auto; diff --git a/AxonIvyPortal/portal/webContent/resources/css/utility.css b/AxonIvyPortal/portal/webContent/resources/css/utility.css index d4c7f8262e4..6b8a3fe3de3 100644 --- a/AxonIvyPortal/portal/webContent/resources/css/utility.css +++ b/AxonIvyPortal/portal/webContent/resources/css/utility.css @@ -396,4 +396,13 @@ .w-full { width: 100%; -} \ No newline at end of file +} + +.scroll-table{ + overflow: auto; + max-height: 50vh; +} + +.w-min { + width: min-content !important; +} diff --git a/AxonIvyPortal/portal/webContent/resources/js/dashboard.js b/AxonIvyPortal/portal/webContent/resources/js/dashboard.js index 3a79ea39ca2..ddcd396b276 100644 --- a/AxonIvyPortal/portal/webContent/resources/js/dashboard.js +++ b/AxonIvyPortal/portal/webContent/resources/js/dashboard.js @@ -75,6 +75,7 @@ function loadGrid() { if (descriptionElement.length > 0) { setupImageProcessWidgetDescription(descriptionElement); } + udateResizableTablesWhenResizeWidget(); setupGridProcessWidget(); }); @@ -290,7 +291,7 @@ function loadCaseAndTaskWidgetFirstTime(loadingClass, widgetClass) { widget.removeClass('u-display-none'); widget.removeClass('u-invisibility'); } - $('.js-resizing').find('table[role="grid"]').addClass('w-fit'); + $('.js-resizing').find('table[role="grid"]').addClass('w-min'); }, 50); } @@ -497,4 +498,34 @@ function searchNewWidgetByNameOrDescription(input) { }); noResult ? $('.js-no-widget').removeClass('u-hidden') : $('.js-no-widget').addClass('u-hidden'); +} + +function udateResizableTablesWhenResizeWidget() { + const scrollableBody = document.querySelectorAll('.ui-datatable-scrollable-body'); + scrollableBody.forEach((sb) => { + let tableBody = $(sb); + if (tableBody.parents('.js-resizing').length == 0) { + return; + } + + let parentHeight = tableBody.parents('.grid-stack-item-content.card.dashboard-card').height(); + if (!window.matchMedia("(max-width: 767px)").matches) { + tableBody.height(parentHeight - 100); + } else { + tableBody.height(parentHeight * 0.9); + } + + const widgetName = tableBody.parents('.grid-stack-item').find('.js-table-widget-var').val(); + if (widgetName === undefined) { + return; + } + + // Update scrolling of the Primefaces widget + const widget = PF(widgetName); + if (widget) { + widget.cfg.scrollHeight = tableBody.parents('.ui-datatable-scrollable').height().toString(); + widget.renderDeferred(widget.cfg); + } + }); + } \ No newline at end of file From 44d3f8f3b0ef9fed6cb50df95f1fa6f5c222cff0 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Thu, 21 Nov 2024 13:52:32 +0700 Subject: [PATCH 02/18] master --- .../addon/portalkit/util/DefaultTaskListDashboardUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DefaultTaskListDashboardUtils.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DefaultTaskListDashboardUtils.java index 0273579b37f..5d872bcb023 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DefaultTaskListDashboardUtils.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/util/DefaultTaskListDashboardUtils.java @@ -5,7 +5,7 @@ public class DefaultTaskListDashboardUtils { public static final String DASHBOARD_TASK_TEMPLATE_JSON = """ { "id": "default-task-list-dashboard", - "version": "11.4.0", + "version": "12.0.0", "templateId": "create-from-scratch", "titles": [ { "locale": "en", "value": "Tasks" }, @@ -26,7 +26,6 @@ public class DefaultTaskListDashboardUtils { { "locale": "es", "value": "Sus tareas" } ], "layout": { "w": 12, "h": 8, "x": 0, "y": 0 }, - "rowsPerPage": 5, "enableQuickSearch": true, "showWidgetInfo": true, "showFullscreenMode": true, From fe05a20a6e0c30b5769ee131544c35f008394016 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Fri, 22 Nov 2024 15:25:31 +0700 Subject: [PATCH 03/18] bug/IVYPORTAL-17918-BUG-Notification-bug-some-lines-have-no-message-and-cause-error-when-clicking-Start _ adapt UI --- .../src/com/axonivy/portal/bean/NotificationBean.java | 4 ++++ .../NotificationFullPage/NotificationFullPage.xhtml | 6 +++--- .../component/NotificationWidget/NotificationWidget.xhtml | 6 +++--- .../portal/webContent/layouts/includes/notification.xhtml | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java b/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java index 13fea63e014..650b84f18b4 100644 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java +++ b/AxonIvyPortal/portal/src/com/axonivy/portal/bean/NotificationBean.java @@ -205,4 +205,8 @@ private void handleTask(Consumer taskHandler) { } } + public boolean isActionAvailible(NotificationDto dto) { + return dto.getRunAction() != null; + } + } diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml index a0bef9b0d40..9b845e08f5f 100644 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml +++ b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/NotificationFullPage/NotificationFullPage.xhtml @@ -53,18 +53,18 @@
- +
-
+ -
+ diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml index cd8d55a27bb..973a3d3eb8d 100644 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml @@ -72,19 +72,19 @@
- +
-
+ -
+ diff --git a/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml b/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml index 923caf320d0..88e7d2224b0 100644 --- a/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml +++ b/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml @@ -87,19 +87,19 @@ - + -
+ -
+ From e7fcc1cf4feb123ec47516f57d1f76ccc4f3c935 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 25 Nov 2024 18:35:49 +0700 Subject: [PATCH 04/18] master _ adapt GUI test --- .../com/axonivy/portal/selenium/test/UploadDocumentTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/UploadDocumentTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/UploadDocumentTest.java index f231297b26e..536641b154e 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/UploadDocumentTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/UploadDocumentTest.java @@ -91,14 +91,17 @@ public void uploadDocumentAndCheckDocumentName() { updateFileExtensionWhiteListInPortalSetting(); initNewDashboardPage(TestAccount.ADMIN_USER); casePage = menuPage.openCaseList(); - caseDetailsPage = casePage.openDetailsCase("Leave Request"); caseDetailsPage.uploadDocumentWithoutError(FileHelper.getAbsolutePathToTestFile(pdfFile)); isCorrectIconExtension(pdfFile, "si si-office-file-pdf-1"); + casePage = menuPage.openCaseList(); + caseDetailsPage = casePage.openDetailsCase("Leave Request"); caseDetailsPage.uploadDocumentWithoutError(FileHelper.getAbsolutePathToTestFile(wordFile)); isCorrectIconExtension(wordFile, "si si-office-file-doc-1"); + casePage = menuPage.openCaseList(); + caseDetailsPage = casePage.openDetailsCase("Leave Request"); caseDetailsPage.uploadDocumentWithoutError(FileHelper.getAbsolutePathToTestFile(unsupportFile)); isCorrectIconExtension(unsupportFile, "si si-common-file-empty"); } From 8876db528c0847b1e69d22db73974a161b476c13 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 25 Nov 2024 18:42:04 +0700 Subject: [PATCH 05/18] master --- .../component/NotificationWidget/NotificationWidget.xhtml | 1 + 1 file changed, 1 insertion(+) diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml index b73634529d4..bf9264b4eda 100644 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/dashboard/component/NotificationWidget/NotificationWidget.xhtml @@ -74,6 +74,7 @@ + From 49a101e68c640816ccf48d06ac988b13c6ee8454 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 25 Nov 2024 18:43:38 +0700 Subject: [PATCH 06/18] master --- .../portal/webContent/layouts/includes/notification.xhtml | 1 - 1 file changed, 1 deletion(-) diff --git a/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml b/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml index 7b15d46666b..eed266974d9 100644 --- a/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml +++ b/AxonIvyPortal/portal/webContent/layouts/includes/notification.xhtml @@ -89,7 +89,6 @@ actionListener="#{notificationBean.goToNotificationDetail(notification, isWorkingOnATask, task)}"> - From c278be806b20fe4a22c72b136db17cda5a4690f2 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Thu, 28 Nov 2024 11:04:03 +0700 Subject: [PATCH 07/18] document/IVYPORTAL-17285-Update-document-for-setting-up-custom-Callable-Dialog-to-show-how-called-process-signature-should-look-like --- .../portalkit/ivydata/service/impl/TaskService.java | 12 ------------ 1 file changed, 12 deletions(-) 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<>(); From 6e7d787f09a9f93ced9b3c85c88ca1865968196b Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Thu, 28 Nov 2024 13:50:53 +0700 Subject: [PATCH 08/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../document/screenshot/PortalCasesScreenshotTest.java | 3 +++ 1 file changed, 3 insertions(+) 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(); From 9aa34aea944285ccc14e869164016b298d28765e Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Fri, 29 Nov 2024 09:01:29 +0700 Subject: [PATCH 09/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../document/screenshot/AdditionalComponentsScreenshotTest.java | 1 + 1 file changed, 1 insertion(+) 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..73873a6c8d2 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 @@ -53,6 +53,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(); From bb069f01b7b6bf18843f25c8237a11ae313d05e0 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 2 Dec 2024 14:06:20 +0700 Subject: [PATCH 10/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests _ adapt Test --- .../screenshot/AdditionalComponentsScreenshotTest.java | 5 +++-- .../document/screenshot/DashboardScreenshotTest.java | 1 - .../document/screenshot/DemoProcessesScreenshotTest.java | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) 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 73873a6c8d2..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(); 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 2d673f25df7..77523a3c0ca 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 @@ -582,7 +582,6 @@ public void screenshotActionWarningDialogWhenStartTask() throws IOException { taskWidget.filterTaskName(taskName, FilterOperator.IS); taskWidget.applyFilter(); - newDashboardPage = new NewDashboardPage(); newDashboardPage.startTask(0); TaskTemplatePage taskIframePage = new TaskTemplatePage(); taskIframePage.switchToIFrameOfTask(); 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"; From dfc98d45c160b084e7213cee5c7752939922a222 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 2 Dec 2024 15:06:20 +0700 Subject: [PATCH 11/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests _ adapt test --- .../selenium/document/screenshot/DashboardScreenshotTest.java | 2 +- .../com/axonivy/portal/selenium/page/CaseMapPage.java | 4 +++- .../com/axonivy/portal/selenium/page/TaskTemplatePage.java | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) 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 77523a3c0ca..238ca8ad6e2 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 @@ -586,7 +586,7 @@ public void screenshotActionWarningDialogWhenStartTask() throws IOException { TaskTemplatePage taskIframePage = new TaskTemplatePage(); taskIframePage.switchToIFrameOfTask(); taskIframePage.clickCancelAndLeftButton(); - taskIframePage.switchBackToParent(); + newDashboardPage = new NewDashboardPage(); newDashboardPage.waitForTaskWidgetLoaded(); 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 c1468a1e32b..d8583969632 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 @@ -252,6 +252,7 @@ public void clickCreateGroupChatBtn() { public void clickCancelAndLeftButton() { waitForElementClickableThenClick("a[id$='button-cancel']"); + switchToDefaultContent(); } public int countSideSteps() { From ca7161b53206c778ba659689c5678b465ce12e1d Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 2 Dec 2024 16:11:20 +0700 Subject: [PATCH 12/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- build/document-screenshot-selenide/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/document-screenshot-selenide/Jenkinsfile b/build/document-screenshot-selenide/Jenkinsfile index 7d77ac2d8b7..32a26e324aa 100644 --- a/build/document-screenshot-selenide/Jenkinsfile +++ b/build/document-screenshot-selenide/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {label 'portal-slave'} + agent {label 'thinh-pc'} options { buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '60')) From 3b823dcdb6c14b8ca39194cb8078f0af298d465f Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Tue, 3 Dec 2024 10:31:45 +0700 Subject: [PATCH 13/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../com/axonivy/portal/selenium/page/TaskTemplatePage.java | 1 + 1 file changed, 1 insertion(+) 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 d8583969632..e7fcf028d6c 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() { From f79347af1474aace73282618d2865c9093e04cb6 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Tue, 3 Dec 2024 11:00:02 +0700 Subject: [PATCH 14/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../document/screenshot/AdditionalComponentsScreenshotTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f1297ecee23..6cf89b19735 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 @@ -60,7 +60,7 @@ public void captureScreenshotGrowlMessage() throws IOException { taskTemplatePage.switchToIFrameOfTask(); taskTemplatePage.clickCancelButton(); ScreenshotUtils.resizeBrowser(new Dimension(1366, 800)); - taskTemplatePage.switchToDefaultContent(); + // taskTemplatePage.switchToDefaultContent(); newDashboardPage = new NewDashboardPage(); newDashboardPage.waitForGrowlMessageDisplayClearly(); ScreenshotUtils From cc9072888c421b27fe883a4fe397b8806dd62a73 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Tue, 3 Dec 2024 16:28:12 +0700 Subject: [PATCH 15/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../screenshot/AdditionalComponentsScreenshotTest.java | 2 +- .../selenium/document/screenshot/DashboardScreenshotTest.java | 1 - .../com/axonivy/portal/selenium/page/TaskTemplatePage.java | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) 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 6cf89b19735..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 @@ -60,7 +60,7 @@ public void captureScreenshotGrowlMessage() throws IOException { taskTemplatePage.switchToIFrameOfTask(); taskTemplatePage.clickCancelButton(); ScreenshotUtils.resizeBrowser(new Dimension(1366, 800)); - // taskTemplatePage.switchToDefaultContent(); + taskTemplatePage.switchToDefaultContent(); newDashboardPage = new NewDashboardPage(); newDashboardPage.waitForGrowlMessageDisplayClearly(); ScreenshotUtils 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 238ca8ad6e2..2b6a353d913 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 @@ -587,7 +587,6 @@ public void screenshotActionWarningDialogWhenStartTask() throws IOException { taskIframePage.switchToIFrameOfTask(); taskIframePage.clickCancelAndLeftButton(); - newDashboardPage = new NewDashboardPage(); newDashboardPage.waitForTaskWidgetLoaded(); newDashboardPage.startTask(0); 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 e7fcf028d6c..7677c191054 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 @@ -253,7 +253,8 @@ public void clickCreateGroupChatBtn() { public void clickCancelAndLeftButton() { waitForElementClickableThenClick("a[id$='button-cancel']"); - switchToDefaultContent(); + clickByJavaScript($(By.linkText("Cancel"))); + switchBackToParent(); } public int countSideSteps() { From 5b9be119b175f2f76682c61252697e69a80604a5 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Tue, 3 Dec 2024 18:28:42 +0700 Subject: [PATCH 16/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../com/axonivy/portal/selenium/page/TaskTemplatePage.java | 1 - 1 file changed, 1 deletion(-) 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 7677c191054..4c1fed434c6 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 @@ -252,7 +252,6 @@ public void clickCreateGroupChatBtn() { } public void clickCancelAndLeftButton() { - waitForElementClickableThenClick("a[id$='button-cancel']"); clickByJavaScript($(By.linkText("Cancel"))); switchBackToParent(); } From 2ad1f55fbd33ed28409edc0bd684cafbc6f92219 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Thu, 5 Dec 2024 09:35:44 +0700 Subject: [PATCH 17/18] Revert "feature/IVYPORTAL-18044-Stabilize-screenshot-tests" This reverts commit ca7161b53206c778ba659689c5678b465ce12e1d. --- build/document-screenshot-selenide/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/document-screenshot-selenide/Jenkinsfile b/build/document-screenshot-selenide/Jenkinsfile index 32a26e324aa..7d77ac2d8b7 100644 --- a/build/document-screenshot-selenide/Jenkinsfile +++ b/build/document-screenshot-selenide/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {label 'thinh-pc'} + agent {label 'portal-slave'} options { buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '60')) From 8d94fd747a7fd5f7318b120cabac7234460921c8 Mon Sep 17 00:00:00 2001 From: nhthinh-axonivy Date: Mon, 9 Dec 2024 09:34:01 +0700 Subject: [PATCH 18/18] feature/IVYPORTAL-18044-Stabilize-screenshot-tests --- .../com/axonivy/portal/selenium/test/task/TaskDetailsTest.java | 1 + 1 file changed, 1 insertion(+) 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();