Skip to content

Commit

Permalink
feature/IVYPORTAL-17431-Remove-Express-from-Portal - Fix gui test part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ntloc-axonivy committed Sep 20, 2024
1 parent 80d9cb7 commit 661f98d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 258 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public enum Variable {
DISPLAY_USERS_OF_TASK_ACTIVATOR("Portal.DisplayUsersOfRole"), ANNOUNCEMENT("Portal.Announcement"),
TASK_ANALYSIS_FILTER("Portal.TaskAnalysisFilters"), THIRD_PARTY_APP("Portal.ThirdPartyApplications"),
STATISTIC_CHART("Portal.StatisticCharts"), EXTERNAL_LINK("Portal.Processes.ExternalLinks"),
EXPRESS_PROCESS("Portal.Processes.ExpressProcesses"), TASK_COLUMN("Portal.Tasks.TaskColumn"),
TASK_FILTER("Portal.Tasks.TaskFilters"),
TASK_COLUMN("Portal.Tasks.TaskColumn"), TASK_FILTER("Portal.Tasks.TaskFilters"),
TASK_BEHAVIOUR_WHEN_CLICKING_ON_LINE_IN_TASK_LIST("Portal.Tasks.BehaviourWhenClickingOnLineInTaskList"),
TASK_DETAIL("Portal.TaskDetails"), CASE_COLUMN("Portal.Cases.CaseColumn"), CASE_FILTER("Portal.Cases.CaseFilters"),
CASE_DETAIL("Portal.CaseDetails"), SHOW_AVATAR("Portal.ShowAvatar"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package com.axonivy.portal.selenium.page;

import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.$$;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import com.codeborne.selenide.SelenideElement;

public class SearchResultPage extends TemplatePage {

private final String INFO_EXPRESS_WORKFlOW = "span[id$='info-workflow']";
private final String EDIT_EXPRESS_WORKFlOW = "a[id$='edit-express-workflow']";
private final String DELETE_EXPRESS_WORKFlOW = "a[id$='delete-express-workflow']";
private final String EXPRESS_PROCESS_LOGO = "span[id$='express-process-logo']";

@Override
protected String getLoadedLocator() {
return "[id$='search-results-tabview']";
Expand Down Expand Up @@ -84,56 +77,6 @@ private ProcessWidgetPage getProcessWidget() {
return new ProcessWidgetPage("search-results-tabview:process-results");
}

public boolean isInfoWorkflowIcon() {
ProcessWidgetPage processWidget = getProcessWidget();
if (processWidget.isImageModeActivated()) {
SelenideElement icon = $(".express-workflow").$(".process-image-view-icon");
return icon.getAttribute("class").contains("si si si-startup-launch");
}

WebElement element = findElementByCssSelector(INFO_EXPRESS_WORKFlOW);
return element.getAttribute("class").contains("si-information-circle");
}

public boolean isEditExpressWorkflow(String processName) {
ProcessWidgetPage processWidget = getProcessWidget();
if (processWidget.isImageModeActivated()) {
SelenideElement actionMenu = getImageProcessActionMenuPanel(processName);
SelenideElement icon = actionMenu.$("a[id$=':image-process-action-component:edit-process']");
return icon != null;
}
SelenideElement element = findElementByCssSelector(EDIT_EXPRESS_WORKFlOW);
return element.getAttribute("class").contains("si-graphic-tablet-drawing-pen");
}

private SelenideElement getImageProcessActionMenuPanel(String processName) {
var selectedProcess = $$("span.process-image-view-name").asFixedIterable().stream()
.filter(process -> processName.equalsIgnoreCase(process.getText())).findFirst().orElse(null);
var processActionMenuId = selectedProcess.getAttribute(ID_PROPERTY).replace("process-item-name", "");
processActionMenuId = processActionMenuId.concat("process-item:image-process-action-component:process-action-menu");
return findElementByCssSelector(String.format("div[id$='%s']", processActionMenuId));
}

public boolean isDeleteExpressWorkflown(String processName) {
ProcessWidgetPage processWidget = getProcessWidget();
if (processWidget.isImageModeActivated()) {
SelenideElement actionMenu = getImageProcessActionMenuPanel(processName);
SelenideElement icon = actionMenu.$("a[id$=':image-process-action-component:delete-process']");
return icon != null;
}
SelenideElement element = findElementByCssSelector(DELETE_EXPRESS_WORKFlOW);
return element.getAttribute("class").contains("si-bin-1");
}

public boolean isExpressProcessLogo() {
ProcessWidgetPage processWidget = getProcessWidget();
if (processWidget.isImageModeActivated()) {
return isInfoWorkflowIcon();
}
SelenideElement element = findElementByCssSelector(EXPRESS_PROCESS_LOGO);
return element.getAttribute("class").contains("si-startup-launch");
}

public boolean isTaskCategoryColumnDisplayed() {
return findElementByCssSelector("span[id$=':task-category-cell']").isDisplayed();
}
Expand All @@ -147,8 +90,4 @@ public void waitForFirstTabFinishedLoading() {
waitForElementDisplayed(By.className("js-loading-process-list"), false);
waitForElementDisplayed(By.className("js-process-start-list-container"), true);
}

public void clickOnActionButton(String processName) {
$(".express-workflow").$("button[id$=':process-action-button']").shouldBe(getClickableCondition()).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public class DashboardProcessWidgetTest extends BaseTest {
private static final String YOUR_PROCESSES = "Your Processes";
private static final String EXPRESS_PROCESS = "EXPRESS_PROCESS";
private static final String EXTERNAL_LINK = "EXTERNAL_LINK";
private static final String CASE_LEAVE_REQUEST_TEST_FOR_IVYPORTAL_3369 =
"Case: Leave Request Test For IVYPORTAL-3369";
private static final String TASK_SICK_LEAVE_REQUEST = "Task: Sick Leave Request";
Expand Down Expand Up @@ -530,7 +531,7 @@ public void testFilterCompactModeProcessFilterProcessNameWhenExpanded() {
public void testFilterCompactModeProcessFilterProcessType() {
newDashboardPage.checkCompactModeProcessDisplayedProcessItem(CREATE_INVESTMENT_IFRAME);

newDashboardPage.applyFilterCompactModeProcessProcessType(EXPRESS_PROCESS);
newDashboardPage.applyFilterCompactModeProcessProcessType(EXTERNAL_LINK);

newDashboardPage.checkCompactModeProcessDisappearedProcessItem(CREATE_INVESTMENT_IFRAME);
}
Expand All @@ -540,7 +541,7 @@ public void testFilterCompactModeProcessFilterProcessTypeWhenExpanded() {
newDashboardPage.checkCompactModeProcessDisplayedProcessItem(CREATE_INVESTMENT_IFRAME);

newDashboardPage.expandCompactModeProcess();
newDashboardPage.applyFilterCompactModeProcessProcessTypeWhenExpanded(EXPRESS_PROCESS);
newDashboardPage.applyFilterCompactModeProcessProcessTypeWhenExpanded(EXTERNAL_LINK);

newDashboardPage.checkCompactModeProcessDisappearedProcessItem(CREATE_INVESTMENT_IFRAME);
}
Expand Down

This file was deleted.

0 comments on commit 661f98d

Please sign in to comment.