Skip to content

Commit

Permalink
Bug/ivyportal 17514 fix g UI tests le (#997)
Browse files Browse the repository at this point in the history
* bug/IVYPORTAL-17514-Fix-GUI-tests-LE

- Remove resetFormattingLanguage method after fixing

* bug/IVYPORTAL-17514-Fix-GUI-tests-LE

- Update AnnouncementTest
  • Loading branch information
lmluat-axonivy authored Aug 28, 2024
1 parent 22ef594 commit cca3c80
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -69,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();
Expand All @@ -83,9 +81,4 @@ public void testDepulishNotification() {
announcementPage.dePublish();
assertTrue(newDashboardPage.isAnnouncementMessageNotDisplayed());
}

@AfterEach
public void resetDefaultFormattingLanguage() {
resetFormattingLanguage();
}
}
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -55,9 +54,4 @@ public void testChangeLanguage() {
private void createTestData() {
redirectToRelativeLink(createTestingTasksUrl);
}

@AfterEach
public void resetDefaultFormattingLanguage() {
resetFormattingLanguage();
}
}

0 comments on commit cca3c80

Please sign in to comment.