Skip to content

Commit

Permalink
Feature/ivyportal 17770 UI facelift for lts 12.0.0 part 3 (#1144)
Browse files Browse the repository at this point in the history
Update new UI on:

Dashboard: Filters widget, Manage saved filters, Widget information, Profile menu dropdown, Actions on Task/Case widget dropdown
all things on Dashboard Configuration
Fix GUI test

---------

Co-authored-by: tphvu-axonivy <[email protected]>
  • Loading branch information
lmluat-axonivy and tphvu-axonivy authored Oct 23, 2024
1 parent ad3a6a7 commit 4c8ac5b
Show file tree
Hide file tree
Showing 43 changed files with 483 additions and 316 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,12 @@ public void removeAllFilterItems() {
}

public void openManageFiltersDialog() {
$("a[id*='case-case_1:filter-form-1']").shouldBe(appear, DEFAULT_TIMEOUT).click();
$("div#manage-filter").shouldBe(appear, DEFAULT_TIMEOUT).$("button").shouldBe(getClickableCondition()).click();
}

public void closeManageFilterDialog() {
$("a[id*='delete-saved-filter-form']").shouldBe(appear, DEFAULT_TIMEOUT).click();
$("div[id$='manage-filter-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).$("a.ui-dialog-titlebar-close")
.shouldBe(appear, DEFAULT_TIMEOUT).click();
}

public ElementsCollection getSavedFilterItemsByFilterNameOnWidgetManagement() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.axonivy.portal.selenium.common.FileHelper;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.DragAndDropOptions;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;

public class DashboardConfigurationPage extends TemplatePage {
Expand Down Expand Up @@ -40,12 +41,11 @@ public SelenideElement getPublicDashboardConfigurationTypeSelection() {
waitForDashboardConfigurationTypeSelectionAppear();
return $("a[id$='public-dashboard-type']");
}

public DashboardModificationPage openEditPublicDashboardsPage() {
selectPublicDashboardType();
$("button[id$='dashboard-modification-component:dashboard-table:0:edit']").shouldBe(appear, DEFAULT_TIMEOUT)
.shouldBe(getClickableCondition());
return new DashboardModificationPage();

public SelenideElement getDashboardConfigurationActionMenu() {
$("button[id*='dashboard-modification-component:dashboard-table:0:dashboard-configuration-action-button']").shouldBe(appear, DEFAULT_TIMEOUT)
.shouldBe(getClickableCondition()).click();
return $$("div[id$='dashboard-configuration-action-menu']").filter(Condition.appear).first();
}

public void selectPublicDashboardType() {
Expand All @@ -62,10 +62,29 @@ public void selectPrivateDashboardType() {

public DashboardModificationPage openEditPrivateDashboardsPage() {
selectPrivateDashboardType();
$("button[id$='dashboard-modification-component:dashboard-table:0:edit']").shouldBe(appear, DEFAULT_TIMEOUT)
.shouldBe(getClickableCondition()).click();
return new DashboardModificationPage();
}

public DashboardModificationPage openEditPrivateDashboardPage(String buttonName) {
selectPrivateDashboardType();
clickButtonOnDashboardConfigurationActionMenu(buttonName);
return new DashboardModificationPage();
}

public DashboardModificationPage openEditPublicDashboardsPage(String buttonName) {
selectPublicDashboardType();
clickButtonOnDashboardConfigurationActionMenu(buttonName);
return new DashboardModificationPage();
}

public DashboardModificationPage openEditPublicDashboardsPage() {
selectPublicDashboardType();
return new DashboardModificationPage();
}

public void clickButtonOnDashboardConfigurationActionMenu(String buttonName) {
getDashboardConfigurationActionMenu().$$("span").filter(Condition.text(buttonName)).first().shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
}

public void openCreatePublicDashboardMenu() {
selectPublicDashboardType();
Expand Down Expand Up @@ -236,12 +255,12 @@ private void selectDashboardIcon(String icon) {
}

public NewDashboardPage backToHomePage() {
$("[id$='back-to-home-button']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
$("span[class*='si si-house-chimney-2']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
return new NewDashboardPage();
}

public NewDashboardPage backToHomePageBottom() {
$("[id$='back-to-home-button']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
$("span[class*='si si-house-chimney-2']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
return new NewDashboardPage();
}

Expand Down Expand Up @@ -317,8 +336,8 @@ private SelenideElement findPrivateDashboardRowByName(String dashboardName) {
}

public void reorderPrivateDashboard(String fromDashboardName, String toDashboardName) {
var toRow = findPrivateDashboardRowByName(toDashboardName).$("i.si-move-expand-vertical");
var fromRow = findPrivateDashboardRowByName(fromDashboardName).$("i.si-move-expand-vertical");
var toRow = findPrivateDashboardRowByName(toDashboardName).$("i.si-navigation-menu");
var fromRow = findPrivateDashboardRowByName(fromDashboardName).$("i.si-navigation-menu");
dragAndDropTo(toRow, fromRow);
}

Expand All @@ -328,8 +347,8 @@ private void dragAndDropTo(SelenideElement toRow, SelenideElement fromRow) {
}

public void reorderPublicDashboard(String fromDashboardName, String toDashboardName) {
var toRow = findPublicDashboardRowByName(toDashboardName).$("i.si-move-expand-vertical");
var fromRow = findPublicDashboardRowByName(fromDashboardName).$("i.si-move-expand-vertical");
var toRow = findPublicDashboardRowByName(toDashboardName).$("i.si-navigation-menu");
var fromRow = findPublicDashboardRowByName(fromDashboardName).$("i.si-navigation-menu");
dragAndDropTo(toRow, fromRow);
}

Expand Down Expand Up @@ -367,7 +386,8 @@ public void cancelMultiLanguageDialog() {
}

public void cancelCreateDashboard() {
$("a[id$='dashboard-creation-component:dashboard-detail-close-button']").shouldBe(getClickableCondition()).click();
$("div[id$='dashboard-creation-details-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).
$("div[class*='ui-corner-top']").shouldBe(appear, DEFAULT_TIMEOUT).$$("a").filter(Condition.attribute("aria-label", "Close")).first().click();
closeAddDashboardDialog();
}

Expand Down Expand Up @@ -398,13 +418,13 @@ public void openImportPrivateDashboards() {
}

public SelenideElement getShareDashboardDialog() {
$("button[id$=':share-dashboard']").click();
$("div[id$=':share-dashboard-dialog']").shouldBe(appear, DEFAULT_TIMEOUT);
clickButtonOnDashboardConfigurationActionMenu("Share");
return $("div[id$=':share-dashboard-dialog']");
}

public void cancelImportDashboard() {
$("a[id$=':dashboard-import-close-button']").shouldBe(getClickableCondition()).click();
$("div[id$='dashboard-import-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).
$("div[class*='ui-corner-top']").shouldBe(appear, DEFAULT_TIMEOUT).$$("a").filter(Condition.attribute("aria-label", "Close")).first().click();
closeAddDashboardDialog();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.codeborne.selenide.CollectionCondition;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.ElementsCollection.SelenideElementIterable;
import com.codeborne.selenide.SelenideElement;

public class DashboardModificationPage extends TemplatePage {
Expand Down Expand Up @@ -39,23 +40,32 @@ private SelenideElement getEditDashboardDialog() {
public NewDashboardDetailsEditPage navigateToEditDashboardDetailsByName(String dashboardName) {
SelenideElement dashboardRow = getDashboardRowByName(dashboardName);
if (dashboardRow != null) {
dashboardRow.$("button[id$='dashboard-modification-component:dashboard-table:0:configure-dashboard']")
.shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
clickButtonOnDashboardConfigurationActionMenu("Configuration", dashboardRow);
NewDashboardDetailsEditPage newDashboardDetailsEditPage = new NewDashboardDetailsEditPage();
return newDashboardDetailsEditPage;
}
return null;
}

private SelenideElement getDashboardConfigurationActionMenu(SelenideElement dashboardRow) {
dashboardRow.$("div#dashboard-configuration-action-group").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("button[id$='dashboard-configuration-action-button']").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
return $$("div[id$='dashboard-configuration-action-menu']").filter(Condition.appear).first();
}

private void clickButtonOnDashboardConfigurationActionMenu(String buttonName, SelenideElement dashboardRow) {
getDashboardConfigurationActionMenu(dashboardRow).$$("span").filter(Condition.text(buttonName)).first().shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
}

public void clickEditDashboardByName(String dashboardName) {
SelenideElement dashboardRow = getDashboardRowByName(dashboardName);
dashboardRow.$("[id$=':edit']").click();
clickButtonOnDashboardConfigurationActionMenu("Edit", dashboardRow);
getEditDashboardDialog().shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

public void clickDeleteDashboardByName(String dashboardName) {
SelenideElement dashboardRow = getDashboardRowByName(dashboardName);
dashboardRow.$("[id$=':delete-dashboard']").click();
clickButtonOnDashboardConfigurationActionMenu("Delete", dashboardRow);
SelenideElement deleteConfirmDialog = $("[id$=':remove-dashboard-dialog']").shouldBe(Condition.appear,
DEFAULT_TIMEOUT);
deleteConfirmDialog.$("button[id$=':remove-dashboard-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
Expand Down Expand Up @@ -124,15 +134,18 @@ public SelenideElement getDashboardCellByNameAndPosition(String dashboardName, i
public SelenideElement getDashboardExportButtonOfDashboard(String dashboardName) {
SelenideElement dashboard = getDashboardRowByName(dashboardName);
dashboard.shouldBe(Condition.appear);
return dashboard.$("td:last-child button[id $=':export-dashboard']");
return getDashboardConfigurationActionMenu(dashboard)
.$$("ul > li > a").filter(Condition.attribute("title", "Export dashboard")).first();
}

public SelenideElement getDashboardShareLinkButton() {
return $("button[id$='share-dashboard']");
SelenideElement dashboardRow = getDashboardRowByName("Dashboard");
return getDashboardConfigurationActionMenu(dashboardRow).$$("span").filter(Condition.text("Share")).first();
}

public void getDashboardShareLinkDialog() {
getDashboardShareLinkButton().shouldBe(Condition.appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
SelenideElement dashboard = getDashboardRowByName("Dashboard");
clickButtonOnDashboardConfigurationActionMenu("Share", dashboard);
$("div[id$=':share-dashboard-dialog']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,20 @@ public void deleteCompactModeProcess() {
}

public void deleteImageModeProcess() {
$("button[id$=':process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
$("[id$=':process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).$("span.si-bin-1")
getProcessActionMenu().shouldBe(Condition.appear, DEFAULT_TIMEOUT).$("span.si-bin-1")
.shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
getRemoveWidgetDialog().shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
getRemoveWidgetButton().click();
getRemoveWidgetDialog().shouldBe(Condition.disappear, DEFAULT_TIMEOUT);
}

private SelenideElement getProcessActionMenu() {
if (!$("[id$=':process-action-menu']").isDisplayed()) {
$("button[id$=':process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.click();
}
return $("div[id$='process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

public void deleteFullModeProcess() {
$("button[id$=':process-action-button']").shouldBe(Condition.appear).click();
Expand Down Expand Up @@ -140,7 +147,7 @@ private void openDeleteCombinedModeProcessDialog() {
}

public ProcessEditWidgetNewDashBoardPage editFullModeProcess() {
$("button[id$=':process-action-button']").shouldBe(Condition.appear).click();
getProcessActionMenu();
$("[id$=':process-item:grid-process-action-component:edit-process']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("span.si-graphic-tablet-drawing-pen").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
$("div[id='new-widget-configuration-dialog']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ public SelenideElement getProcessImage() {
}

public ProcessEditWidgetNewDashBoardPage editImageModeProcess() {
$("button[id$='image-process-action-component:process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.click();
if (!$("[id$=':image-process-action-component:process-action-menu']").isDisplayed()) {
$("button[id$='image-process-action-component:process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.click();
}
$("[id$=':image-process-action-component:process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("span.si-graphic-tablet-drawing-pen").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
$("div[id='new-widget-configuration-dialog']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
Expand Down Expand Up @@ -212,20 +214,24 @@ public void startProcess() {
}

public void startMoreInfoLink() {
getMoreInformationLink().click();
$("div[id$='process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$$("span[class$='ui-menuitem-text']").filter(Condition.text("More Information")).first().click();
}

public SelenideElement getDisabledMoreInformationLink() {
return $("span[id$=':more-information']");
return getProcessActionMenu().$$("span[class$='ui-menuitem-text']").filter(Condition.text("More Information")).first();
}

private SelenideElement getProcessActionMenu() {
$("div#process-action-group").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
if (!$("[id$=':process-action-menu']").isDisplayed()) {
$("button[id$=':process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.click();
}
return $("div[id$='process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

public SelenideElement getMoreInformationLink() {
return $("a[id$=':more-information']");
return getProcessActionMenu().$$("span[class$='ui-menuitem-text']").filter(Condition.text("More Information")).first();
}

public SelenideElement getFullModeProcessName() {
Expand Down Expand Up @@ -653,8 +659,8 @@ public void openCompactModeProcessManageFilters() {
}

public void closeCompactModeProcessManagerFilters() {
getManageWidgetFilterDialogCloseLink().shouldBe(Condition.appear).click();
getManageWidgetFilterDialog().shouldBe(disappear, DEFAULT_TIMEOUT);
$("div[id$='manage-filter-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).$("a.ui-dialog-titlebar-close")
.shouldBe(appear, DEFAULT_TIMEOUT).click();
}

public void removeCompactModeProcessFilter() {
Expand Down Expand Up @@ -874,7 +880,7 @@ public SelenideElement getWidgetFilter(int index) {

public void closeWidgetFilter(int index) {
var widgetFilterPanel = $("div[id$=':filter-overlay-panel-" + index + "']").shouldBe(appear, DEFAULT_TIMEOUT);
widgetFilterPanel.$(".ui-overlaypanel-footer__cancel").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
widgetFilterPanel.$("div[id*='widget-filter-content']").shouldBe(appear, DEFAULT_TIMEOUT).$("div[class*='filter-overlay-panel__header']").shouldBe(appear, DEFAULT_TIMEOUT).$("button[id*='filter-form-" + index + "']").should(getClickableCondition(), DEFAULT_TIMEOUT).click();
widgetFilterPanel.shouldBe(disappear, DEFAULT_TIMEOUT);
}

Expand Down Expand Up @@ -1029,8 +1035,7 @@ public NotificationCompactPage openNotificationPanel() {
}

public void clickOnManageFilterLink() {
var savedFilterContainer = $("[id$=':saved-filters-container']").shouldBe(appear, DEFAULT_TIMEOUT);
savedFilterContainer.$(".ui-commandlink.saved-filter__manage-filter").shouldBe(getClickableCondition()).click();
$("div[class*='filter-overlay-panel__footer']").shouldBe(appear, DEFAULT_TIMEOUT).$("div#manage-filter").shouldBe(appear, DEFAULT_TIMEOUT).$("button[class*='saved-filter__manage-filter']").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
$("[id$='manage-filter-dialog']").shouldBe(appear, DEFAULT_TIMEOUT);
}

Expand All @@ -1045,7 +1050,9 @@ public ElementsCollection getTotalSavedFilterInManageFilterDialog() {
}

public void closeManageFilterDialog() {
$("[id$=':manage-filter-action']").$("a").shouldBe(getClickableCondition()).click();
$("div[id*='manage-filter-dialog']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("div[class*='ui-widget-header']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("a[class*='ui-dialog-titlebar-close']").shouldBe(getClickableCondition()).click();
$("[id$='manage-filter-dialog']").shouldBe(disappear, DEFAULT_TIMEOUT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ public SelenideElement getFullModeProcessPreview() {
}

public SelenideElement getDisabledMoreInformationLink() {
return $("span[id$=':more-information']");
return getProcessActionMenu().$$("span[class$='ui-menuitem-text']").filter(Condition.text("More Information")).first();
}

private SelenideElement getProcessActionMenu() {
$("div[class*='image-process-item-container']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).$("button[id$='process-action-button']").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
return $("div[id$='process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

public void selectFullModeProcessAndSaveWidget(String processName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,9 @@ public void deleteGridProcess(int index) {
}

public void clickMoreInformationLinkImage(String processName) {
SelenideElement processItem = getProcessItem(processName);
processItem.$(By.cssSelector(".more-information-wrapper")).click();
getProcessActionMenu(processName)
.$("ul[class*='ui-helper-reset']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$$("li > a > span").filter(Condition.exactText("More Information")).first().click();;
}

public void clickMoreInformationLink(String processName) {
Expand All @@ -363,7 +364,7 @@ public void clickMoreInformationLink(String processName) {
private SelenideElement getProcessActionMenu(String processName) {
SelenideElement processItem = getProcessItem(processName);
processItem.$("button[id*=':process-action-button']").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
return $$("div[id$='process-action-menu']").filter(Condition.appear).first();
return $$("div[id$='process-action-menu']").filter(Condition.appear).first();
}

public SelenideElement getProcessItem(String processName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ReorderDashboardPage extends TemplatePage {

@Override
protected String getLoadedLocator() {
return "i.si-move-expand-vertical";
return "i.dashboard-icon-drag-drop";
}

public void toggleVisibility(String dashboardName) {
Expand All @@ -22,8 +22,8 @@ public void toggleVisibility(String dashboardName) {
}

public void reorderPrivateDashboard(String fromDashboardName, String toDashboardName) {
var toRow = findPrivateDashboardRowByName(toDashboardName).$("i.si-move-expand-vertical");
var fromRow = findPrivateDashboardRowByName(fromDashboardName).$("i.si-move-expand-vertical");
var toRow = findPrivateDashboardRowByName(toDashboardName).$("i.si-navigation-menu");
var fromRow = findPrivateDashboardRowByName(fromDashboardName).$("i.si-navigation-menu");
dragAndDropTo(toRow, fromRow);
}

Expand All @@ -33,8 +33,8 @@ private void dragAndDropTo(SelenideElement toRow, SelenideElement fromRow) {
}

public void reorderPublicDashboard(String fromDashboardName, String toDashboardName) {
var toRow = findPublicDashboardRowByName(toDashboardName).$("i.si-move-expand-vertical");
var fromRow = findPublicDashboardRowByName(fromDashboardName).$("i.si-move-expand-vertical");
var toRow = findPublicDashboardRowByName(toDashboardName).$("i.si-navigation-menu");
var fromRow = findPublicDashboardRowByName(fromDashboardName).$("i.si-navigation-menu");
dragAndDropTo(toRow, fromRow);
}

Expand Down
Loading

0 comments on commit 4c8ac5b

Please sign in to comment.