From 2c525b0a904bbab49212b95aa90d177ac2ae3603 Mon Sep 17 00:00:00 2001 From: Vu Tong <129731357+tphvu-axonivy@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:38:45 +0700 Subject: [PATCH] IVYPORTAL-18045-Check-and-beautify-screenshot-MASTER (#1289) - improve screenshot picture - Update document --- .../resources/css/document-screenshot.css | 9 +++++++++ .../resources/js/document-screenshot.js | 2 ++ .../document/screenshot/DashboardScreenshotTest.java | 5 +---- .../screenshot/HandleErrorPageScreenshotTest.java | 2 +- .../document/screenshot/SettingScreenshotTest.java | 1 + .../source/portal-user-guide/admin-settings/index.rst | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/resources/css/document-screenshot.css b/AxonIvyPortal/portal-selenium-test/resources/css/document-screenshot.css index a6e51bbe0a8..015f547d564 100644 --- a/AxonIvyPortal/portal-selenium-test/resources/css/document-screenshot.css +++ b/AxonIvyPortal/portal-selenium-test/resources/css/document-screenshot.css @@ -1,3 +1,12 @@ +/*****CSS FOR DECORATE SCREENSHOT***** + THIS scrollbar-width is used to prevent + the gap on the right side when selenide taking screenshot + it only happens on Linux environment. +*/ +html { + scrollbar-width: none; +} + /*****CSS FOR DECORATE SCREENSHOT******/ .marker { position: absolute; diff --git a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js index dca9849fadd..72d33cbad1f 100644 --- a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js +++ b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js @@ -42,6 +42,8 @@ function highlightTopBar() { $(themeSwitchIcon).addClass("red-topbottom-medium-border"); var chatItem = topMenu.find("li.topbar-item.chat-item"); $(chatItem).addClass("red-topbottom-medium-border"); + var notificationIcon = $("#open-notifications-panel")[0].parentElement; + $(notificationIcon).addClass("red-topbottom-medium-border"); var userNameItem = topMenu.find("li.topbar-item.user-profile.setting-container"); $(userNameItem).addClass("red-topbottomright-medium-border"); } 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..bdd8fc0b44f 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 @@ -42,7 +42,6 @@ import com.axonivy.portal.selenium.util.ConfigurationJsonUtils; import com.codeborne.selenide.CollectionCondition; import com.codeborne.selenide.Condition; -import com.codeborne.selenide.SelenideElement; import ch.ivy.addon.portalkit.enums.PortalVariable; @@ -354,10 +353,8 @@ public void screenshotTaskByPriorityClientStatisticChartWidget() throws IOExcept NewDashboardDetailsEditPage newDashboard = new NewDashboardDetailsEditPage(); newDashboard.waitPageLoaded(); - SelenideElement clientStatisticWidget = newDashboard.getStatisticWidgetConfigurationDialog(); ScreenshotUtils.capturePageScreenshot(ScreenshotUtils.NEW_DASHBOARD_FOLDER + "edit-statistic-widget"); - ScreenshotUtils.captureElementWithMarginOptionScreenshot(clientStatisticWidget, - ScreenshotUtils.NEW_DASHBOARD_FOLDER + "task-by-priority-statistic-widget-configuration", new ScreenshotMargin(20)); + ScreenshotUtils.capturePageScreenshot(ScreenshotUtils.NEW_DASHBOARD_FOLDER + "task-by-priority-statistic-widget-configuration"); redirectToRelativeLink(PORTAL_HOME_PAGE_URL); homePage = new NewDashboardPage(); ScreenshotUtils.captureElementScreenshot(homePage.waitAndGetClientStatisticChart(0), diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/HandleErrorPageScreenshotTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/HandleErrorPageScreenshotTest.java index eb9c4195300..1832ffb06bd 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/HandleErrorPageScreenshotTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/HandleErrorPageScreenshotTest.java @@ -25,7 +25,7 @@ public class HandleErrorPageScreenshotTest extends ScreenshotBaseTest { @Test public void screenshotErrorPages() throws IOException { - ScreenshotUtils.resizeBrowser(new Dimension(1200, 800)); + ScreenshotUtils.resizeBrowser(new Dimension(1280, 720)); redirectToRelativeLink(portalCustomErrorUrl); $("[id$=':test-error-method']").shouldBe(exist, DEFAULT_TIMEOUT).shouldBe(visible, DEFAULT_TIMEOUT).click(); $(".notification-container").shouldBe(appear, DEFAULT_TIMEOUT); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/SettingScreenshotTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/SettingScreenshotTest.java index 5dc65eaaaad..072d0743de7 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/SettingScreenshotTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/document/screenshot/SettingScreenshotTest.java @@ -52,6 +52,7 @@ public void screenshotAdminSettings() throws IOException { ScreenshotUtils.captureElementWithMarginOptionScreenshot(adminSettingsPage.getEditSettingDialogOfFirstRow(), ScreenshotUtils.SETTINGS_FOLDER + "edit-global-settings", new ScreenshotMargin(20)); adminSettingsPage.closeEditSettingDialog(); + refreshPage(); adminSettingsPage.openAnnouncementTab(); ScreenshotUtils.captureElementWithMarginOptionScreenshot(adminSettingsPage.getAdminSettingContainer(), diff --git a/Documentation/portal-guide/source/portal-user-guide/admin-settings/index.rst b/Documentation/portal-guide/source/portal-user-guide/admin-settings/index.rst index b1df12f1140..bd4bfc13470 100644 --- a/Documentation/portal-guide/source/portal-user-guide/admin-settings/index.rst +++ b/Documentation/portal-guide/source/portal-user-guide/admin-settings/index.rst @@ -39,7 +39,7 @@ HowTo: Add a Third Party Application #. Enter its URL in :guilabel:`Link`, e.g. http://www.google.com. -#. Click on :guilabel:`Ok`. +#. Click on :guilabel:`Save`. .. _update-portal-settings: