From f8c80b4589b6d88db0c429adca35c570c1458e36 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Mon, 26 Aug 2024 17:56:11 +0700 Subject: [PATCH 01/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Update LanguageSettingTest --- .../com/axonivy/portal/selenium/test/LanguageSettingTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java index 5efcd1b3e04..47fa32fa963 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java @@ -45,6 +45,7 @@ public void testChangeLanguage() { assertEquals("Prozesse", mainMenuPage.getProcessMenuItemText()); userProfilePage = newDashboardPage.openMyProfilePage(); userProfilePage.selectLanguage(1); + userProfilePage.inputFormattingLanguage("English"); userProfilePage.save(); mainMenuPage = userProfilePage.openMainMenu(); mainMenuPage.waitPageLoaded(); From 559775e4f2ae1a8a620ae2335bf6381961800f44 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 13:36:38 +0700 Subject: [PATCH 02/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Update GUI tests --- .../portal/selenium/test/LanguageSettingTest.java | 10 +++++++++- .../axonivy/portal/selenium/test/LeaveRequestTest.java | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java index 47fa32fa963..e68a624bad2 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java @@ -1,5 +1,6 @@ package com.axonivy.portal.selenium.test; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -45,7 +46,6 @@ public void testChangeLanguage() { assertEquals("Prozesse", mainMenuPage.getProcessMenuItemText()); userProfilePage = newDashboardPage.openMyProfilePage(); userProfilePage.selectLanguage(1); - userProfilePage.inputFormattingLanguage("English"); userProfilePage.save(); mainMenuPage = userProfilePage.openMainMenu(); mainMenuPage.waitPageLoaded(); @@ -55,5 +55,13 @@ public void testChangeLanguage() { private void createTestData() { redirectToRelativeLink(createTestingTasksUrl); } + + @AfterEach + public void resetFormattingLanguage() { + NewDashboardPage newDashboardPage = new NewDashboardPage(); + UserProfilePage userProfilePage = newDashboardPage.openMyProfilePage(); + userProfilePage.inputFormattingLanguage("English (United Kingdom)"); + newDashboardPage = userProfilePage.save(); + } } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java index f372f14e17a..b14a79e2977 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java @@ -5,6 +5,7 @@ import java.time.format.DateTimeFormatter; import java.util.Locale; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,6 +17,7 @@ import com.axonivy.portal.selenium.page.LeaveRequestPage; import com.axonivy.portal.selenium.page.NewDashboardPage; import com.axonivy.portal.selenium.page.TaskWidgetPage; +import com.axonivy.portal.selenium.page.UserProfilePage; @IvyWebTest public class LeaveRequestTest extends BaseTest { From db7e4588f83ec255de094af0f5aac98a4497c8b8 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 13:36:52 +0700 Subject: [PATCH 03/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - add headless false --- .../com/axonivy/portal/selenium/test/task/TaskActionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java index 6f39d5bc5ae..45d7f7b4afd 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java @@ -18,7 +18,7 @@ import com.axonivy.portal.selenium.page.TaskIFrameTemplatePage; import com.axonivy.portal.selenium.page.TaskWidgetPage; -@IvyWebTest +@IvyWebTest(headless = false) public class TaskActionTest extends BaseTest { private TaskWidgetPage taskWidgetPage; From 6ae376c8e77845fedb523b9a70189cc087b7d854 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 13:37:39 +0700 Subject: [PATCH 04/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Update label --- build/gui-test-new-dashboard/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gui-test-new-dashboard/Jenkinsfile b/build/gui-test-new-dashboard/Jenkinsfile index dc28edd480e..4ba46e677e2 100644 --- a/build/gui-test-new-dashboard/Jenkinsfile +++ b/build/gui-test-new-dashboard/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {label 'portal-slave'} + agent {label 'luat-pc'} options { buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '60')) From 3abcf1a92732dae30240ced070962ef06ebd3b5a Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 13:43:43 +0700 Subject: [PATCH 05/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Remove unused code --- .../com/axonivy/portal/selenium/test/LanguageSettingTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java index 46481a1d7fd..e68a624bad2 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java @@ -46,7 +46,6 @@ public void testChangeLanguage() { assertEquals("Prozesse", mainMenuPage.getProcessMenuItemText()); userProfilePage = newDashboardPage.openMyProfilePage(); userProfilePage.selectLanguage(1); - userProfilePage.inputFormattingLanguage("English"); userProfilePage.save(); mainMenuPage = userProfilePage.openMainMenu(); mainMenuPage.waitPageLoaded(); From 18b2c17eb0587d51dd71c314e608883e2e86bb87 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 16:08:15 +0700 Subject: [PATCH 06/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Update GUI tests --- .../com/axonivy/portal/selenium/common/BaseTest.java | 9 +++++++++ .../axonivy/portal/selenium/test/AnnouncementTest.java | 7 +++++++ .../portal/selenium/test/LanguageSettingTest.java | 8 ++------ .../portal/selenium/test/PortalPermissionTest.java | 4 +++- .../axonivy/portal/selenium/test/QuickSearchTest.java | 3 +-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java index dbc447954a1..12cf9c1bb98 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java @@ -17,6 +17,8 @@ import org.openqa.selenium.support.ui.WebDriverWait; import com.axonivy.ivy.webtest.engine.EngineUrl; +import com.axonivy.portal.selenium.page.NewDashboardPage; +import com.axonivy.portal.selenium.page.UserProfilePage; import com.codeborne.selenide.Condition; import com.codeborne.selenide.WebDriverRunner; @@ -344,6 +346,13 @@ public void createJSonFile(String jsonFile, String key) { } redirectToRelativeLink(String.format(createJSonFileUrl, filepath, key)); } + + public void resetFormattingLanguage() { + NewDashboardPage newDashboardPage = new NewDashboardPage(); + UserProfilePage userProfilePage = newDashboardPage.openMyProfilePage(); + userProfilePage.inputFormattingLanguage("English (United Kingdom)"); + newDashboardPage = userProfilePage.save(); + } protected void showNewDashboard() { redirectToRelativeLink(PORTAL_HOME_PAGE_URL); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java index e6d401a2db3..c61402c87d4 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java @@ -1,5 +1,7 @@ package com.axonivy.portal.selenium.test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -81,4 +83,9 @@ public void testDepulishNotification() { announcementPage.dePublish(); assertTrue(newDashboardPage.isAnnouncementMessageNotDisplayed()); } + + @AfterEach + public void resetDefaultFormattingLanguage() { + resetFormattingLanguage(); + } } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java index e68a624bad2..ffe74d1303f 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java @@ -57,11 +57,7 @@ private void createTestData() { } @AfterEach - public void resetFormattingLanguage() { - NewDashboardPage newDashboardPage = new NewDashboardPage(); - UserProfilePage userProfilePage = newDashboardPage.openMyProfilePage(); - userProfilePage.inputFormattingLanguage("English (United Kingdom)"); - newDashboardPage = userProfilePage.save(); + public void resetDefaultFormattingLanguage() { + resetFormattingLanguage(); } - } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java index 8054c3d8b6f..67ce73de70b 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java @@ -36,7 +36,8 @@ public void setup() { grantAccessFullListPermissions(); newDashboardPage = new NewDashboardPage(); } - + + @Override @AfterEach public void tearDown() { grantTaskActionsPermissions(); @@ -44,6 +45,7 @@ public void tearDown() { grantShowHideNotePermissions(); grantDocumentOfInvolvedCaseWritePemissionToCurrentUser(); grantCasePermissions(); + grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); } @Test diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/QuickSearchTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/QuickSearchTest.java index c538c60147b..6a109b185b3 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/QuickSearchTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/QuickSearchTest.java @@ -389,9 +389,8 @@ public void testQuickSearchInProcessWidget() { @Test public void testSessionCacheInProcessWidget() { login(TestAccount.ADMIN_USER); - ProcessWidgetNewDashBoardPage processWidget = newDashboardPage.selectProcessWidget("Your Processes"); - assertTrue(processWidget.isQuickSearchInputShow()); ScreenshotUtils.maximizeBrowser(); + ProcessWidgetNewDashBoardPage processWidget = newDashboardPage.selectProcessWidget("Your Processes"); processWidget.setQuickSearchKeyword("login"); var configurationPage = newDashboardPage.openDashboardConfigurationPage(); DashboardModificationPage modificationPage = configurationPage.openEditPublicDashboardsPage(); From fd2bdb4bff846859649605bea64b786f9a38cf05 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 16:08:40 +0700 Subject: [PATCH 07/12] Revert "bug/IVYPORTAL-17514-Fix-GUI-tests-LE" This reverts commit 6ae376c8e77845fedb523b9a70189cc087b7d854. --- build/gui-test-new-dashboard/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gui-test-new-dashboard/Jenkinsfile b/build/gui-test-new-dashboard/Jenkinsfile index 4ba46e677e2..dc28edd480e 100644 --- a/build/gui-test-new-dashboard/Jenkinsfile +++ b/build/gui-test-new-dashboard/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {label 'luat-pc'} + agent {label 'portal-slave'} options { buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '60')) From eafb2ee03798980082b96503a09354466979065e Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 16:09:14 +0700 Subject: [PATCH 08/12] Revert "bug/IVYPORTAL-17514-Fix-GUI-tests-LE" This reverts commit db7e4588f83ec255de094af0f5aac98a4497c8b8. --- .../com/axonivy/portal/selenium/test/task/TaskActionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java index 45d7f7b4afd..6f39d5bc5ae 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java @@ -18,7 +18,7 @@ import com.axonivy.portal.selenium.page.TaskIFrameTemplatePage; import com.axonivy.portal.selenium.page.TaskWidgetPage; -@IvyWebTest(headless = false) +@IvyWebTest public class TaskActionTest extends BaseTest { private TaskWidgetPage taskWidgetPage; From 1a76c6f64d9d225563a2eb0834533d924fcfbec7 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 17:55:06 +0700 Subject: [PATCH 09/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Grant permission for admin user --- .../axonivy/portal/selenium/test/PortalPermissionTest.java | 1 - .../axonivy/portal/selenium/test/task/TaskActionTest.java | 5 +++++ .../axonivy/portal/selenium/test/task/TaskDetailsTest.java | 1 + .../axonivy/portal/selenium/test/task/TaskWidgetTest.java | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java index 67ce73de70b..5643b03f749 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/PortalPermissionTest.java @@ -45,7 +45,6 @@ public void tearDown() { grantShowHideNotePermissions(); grantDocumentOfInvolvedCaseWritePemissionToCurrentUser(); grantCasePermissions(); - grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); } @Test diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java index 6f39d5bc5ae..eda5b354a50 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskActionTest.java @@ -18,6 +18,8 @@ import com.axonivy.portal.selenium.page.TaskIFrameTemplatePage; import com.axonivy.portal.selenium.page.TaskWidgetPage; +import ch.ivy.addon.portalkit.enums.PortalPermission; + @IvyWebTest public class TaskActionTest extends BaseTest { @@ -90,6 +92,7 @@ public void testVisibilityTaskActionForNormalUser() { @Test public void testVisibilityTaskActionForAdminUser() { login(TestAccount.ADMIN_USER); + grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); redirectToRelativeLink(createTaskWithSystemState); taskWidgetPage = NavigationHelper.navigateToTaskList(); // Ready for Join @@ -134,6 +137,7 @@ public void testVisibilityTaskActionForAdminUser() { @Test public void testVisibleTaskActionsWhenTaskStatusIsDoneAndDestroyed() { login(TestAccount.ADMIN_USER); + grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); redirectToRelativeLink(createTaskWithSystemState); taskWidgetPage = NavigationHelper.navigateToTaskList(); @@ -162,6 +166,7 @@ public void testVisibleTaskActionsWhenTaskStatusIsDoneAndDestroyed() { @Test public void testVisibilityTaskActionForTechnicalStates() { login(TestAccount.ADMIN_USER); + grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); redirectToRelativeLink(createTechnicalStateUrl); taskWidgetPage = NavigationHelper.navigateToTaskList(); 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 34d01f6d0b7..951810d7893 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 @@ -105,6 +105,7 @@ public void testShareTaskDetails() { public void testShowTaskStatusBannerOnTaskDetails() { redirectToRelativeLink(createTestingTasksUrl); login(TestAccount.ADMIN_USER); + grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); redirectToNewDashBoard(); MainMenuPage mainMenuPage = new MainMenuPage(); mainMenuPage.openTaskList(); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskWidgetTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskWidgetTest.java index 74a9b76ce2e..5a7c267e133 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskWidgetTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/task/TaskWidgetTest.java @@ -21,6 +21,8 @@ import com.codeborne.selenide.CollectionCondition; import com.codeborne.selenide.Condition; +import ch.ivy.addon.portalkit.enums.PortalPermission; + @IvyWebTest public class TaskWidgetTest extends BaseTest { @@ -113,6 +115,7 @@ public void testDisplayDelegateButton() { @Test public void testDestroyTask() { login(TestAccount.ADMIN_USER); + grantSpecificPortalPermission(PortalPermission.SYSTEM_TASK_READ_ALL); redirectToRelativeLink(GRANT_DESTROY_TASK_URL); TaskWidgetPage taskWidgetPage = NavigationHelper.navigateToTaskList(); From 3f22f4514d87b162f26cd847bb3b5194d2f49e4a Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Tue, 27 Aug 2024 17:56:22 +0700 Subject: [PATCH 10/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Format code --- .../com/axonivy/portal/selenium/test/LeaveRequestTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java index b14a79e2977..7025963016a 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LeaveRequestTest.java @@ -2,10 +2,10 @@ import java.time.LocalDateTime; + import java.time.format.DateTimeFormatter; import java.util.Locale; -import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -17,7 +17,6 @@ import com.axonivy.portal.selenium.page.LeaveRequestPage; import com.axonivy.portal.selenium.page.NewDashboardPage; import com.axonivy.portal.selenium.page.TaskWidgetPage; -import com.axonivy.portal.selenium.page.UserProfilePage; @IvyWebTest public class LeaveRequestTest extends BaseTest { From 8f6f86ce05cb9b9c0597324c3f85f178a36b2f37 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Wed, 28 Aug 2024 11:48:57 +0700 Subject: [PATCH 11/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Remove resetFormattingLanguage method after fixing --- .../com/axonivy/portal/selenium/common/BaseTest.java | 10 +--------- .../axonivy/portal/selenium/test/AnnouncementTest.java | 7 ------- .../portal/selenium/test/LanguageSettingTest.java | 6 ------ 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java index 12cf9c1bb98..bc5d20ce0a8 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/common/BaseTest.java @@ -1,6 +1,7 @@ package com.axonivy.portal.selenium.common; import static com.codeborne.selenide.Condition.exist; + import static com.codeborne.selenide.Selenide.$; import static com.codeborne.selenide.Selenide.open; import static com.codeborne.selenide.Selenide.refresh; @@ -17,8 +18,6 @@ import org.openqa.selenium.support.ui.WebDriverWait; import com.axonivy.ivy.webtest.engine.EngineUrl; -import com.axonivy.portal.selenium.page.NewDashboardPage; -import com.axonivy.portal.selenium.page.UserProfilePage; import com.codeborne.selenide.Condition; import com.codeborne.selenide.WebDriverRunner; @@ -347,13 +346,6 @@ public void createJSonFile(String jsonFile, String key) { redirectToRelativeLink(String.format(createJSonFileUrl, filepath, key)); } - public void resetFormattingLanguage() { - NewDashboardPage newDashboardPage = new NewDashboardPage(); - UserProfilePage userProfilePage = newDashboardPage.openMyProfilePage(); - userProfilePage.inputFormattingLanguage("English (United Kingdom)"); - newDashboardPage = userProfilePage.save(); - } - protected void showNewDashboard() { redirectToRelativeLink(PORTAL_HOME_PAGE_URL); } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java index c61402c87d4..e6d401a2db3 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java @@ -1,7 +1,5 @@ package com.axonivy.portal.selenium.test; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -83,9 +81,4 @@ public void testDepulishNotification() { announcementPage.dePublish(); assertTrue(newDashboardPage.isAnnouncementMessageNotDisplayed()); } - - @AfterEach - public void resetDefaultFormattingLanguage() { - resetFormattingLanguage(); - } } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java index ffe74d1303f..8e390f28a0e 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/LanguageSettingTest.java @@ -1,6 +1,5 @@ package com.axonivy.portal.selenium.test; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -55,9 +54,4 @@ public void testChangeLanguage() { private void createTestData() { redirectToRelativeLink(createTestingTasksUrl); } - - @AfterEach - public void resetDefaultFormattingLanguage() { - resetFormattingLanguage(); - } } From defc3c7b5b724ab644992a05789d60036be7b1de Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Wed, 28 Aug 2024 16:10:11 +0700 Subject: [PATCH 12/12] bug/IVYPORTAL-17514-Fix-GUI-tests-LE - Update AnnouncementTest --- .../com/axonivy/portal/selenium/page/AnnouncementPage.java | 4 ++-- .../com/axonivy/portal/selenium/test/AnnouncementTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/AnnouncementPage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/AnnouncementPage.java index 2a526d729c6..400b11cd410 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/AnnouncementPage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/AnnouncementPage.java @@ -1,5 +1,6 @@ package com.axonivy.portal.selenium.page; +import static com.codeborne.selenide.Condition.appear; import static com.codeborne.selenide.Selenide.$; import org.openqa.selenium.By; @@ -14,8 +15,7 @@ protected String getLoadedLocator() { } public String getInfoSummary() { - return WebDriverRunner.getWebDriver().findElement(By.cssSelector("div[id$='messages'] span[class$='summary']")) - .getText(); + return $("div[id$='announcement-tab']").shouldBe(appear, DEFAULT_TIMEOUT).$("span.ui-messages-error-summary").shouldBe(appear, DEFAULT_TIMEOUT).getText(); } public void publish() { diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java index e6d401a2db3..bb8196ebaf1 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/AnnouncementTest.java @@ -67,7 +67,7 @@ public void testShouldDisplayNotification() { } @Test - public void testDepulishNotification() { + public void testDepublishNotification() { NewDashboardPage newDashboardPage = new NewDashboardPage(); AdminSettingsPage adminSettingsPage = newDashboardPage.openAdminSettings(); AnnouncementPage announcementPage = adminSettingsPage.openAnnouncementTab();