Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVYPORTAL-17514 Fix GUI tests #997

Merged
merged 14 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
Loading