Skip to content

Commit

Permalink
feature/IVYPORTAL-17427-Remove-old-statistics-Area - Remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
ntloc-axonivy committed Sep 11, 2024
1 parent 9ff9104 commit 817d305
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 1,682 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

import com.axonivy.portal.selenium.page.CaseWidgetPage;
import com.axonivy.portal.selenium.page.ProcessWidgetPage;
import com.axonivy.portal.selenium.page.StatisticWidgetPage;
import com.axonivy.portal.selenium.page.TaskWidgetPage;

public class NavigationHelper {
private static final String TASK_LIST_PAGE_URL = "portal/1549F58C18A6C562/DefaultTaskListPage.ivp";
private static final String CASE_LIST_PAGE_URL = "portal/1549F58C18A6C562/CaseListPage.ivp";
private static final String PROCESS_LIST_PAGE_URL = "portal/1549F58C18A6C562/DefaultProcessStartListPage.ivp";
private static final String STATISTIC_PAGE_URL = "portal/1549F58C18A6C562/StatisticPage.ivp";

public static void navigateToRelativeLink(String relativeProcessStartUrl) {
try {
Expand All @@ -36,8 +34,4 @@ public static ProcessWidgetPage navigateToProcessList() {
return new ProcessWidgetPage();
}

public static StatisticWidgetPage navigateToStatisticPage() {
navigateToRelativeLink(STATISTIC_PAGE_URL);
return new StatisticWidgetPage();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.axonivy.portal.selenium.page.NewDashboardPage;
import com.axonivy.portal.selenium.page.ProcessHistoryPage;
import com.axonivy.portal.selenium.page.ProcessViewerPage;
import com.axonivy.portal.selenium.page.StatisticWidgetPage;
import com.axonivy.portal.selenium.page.TaskTemplatePage;
import com.axonivy.portal.selenium.page.component.DocumentTableComponentPage;
import com.axonivy.portal.selenium.page.component.ProcessViewerComponentPage;
Expand Down Expand Up @@ -94,21 +93,6 @@ public void captureScreenshotDocumentTableComponent() throws IOException {
ScreenshotUtils.capturePageScreenshot(ScreenshotUtils.COMPONENTS_FOLDER + "document-table");
}

@Test
public void captureScreenshotTaskAnalysisComponent() throws IOException {
redirectToRelativeLink(create12CasesWithCategoryUrl);
redirectToRelativeLink(createTestingTasksUrl);
login(TestAccount.ADMIN_USER);
showNewDashboard();
NewDashboardPage homepage = new NewDashboardPage();
homepage.waitForCaseWidgetLoaded();
MainMenuPage mainMenuPage = new MainMenuPage();
StatisticWidgetPage statisticWidgetDashboardPage = mainMenuPage.openStatisticPage();
statisticWidgetDashboardPage.navigateToTaskAnalysisPage();
ScreenshotUtils.resizeBrowser(new Dimension(1500, 1000));
ScreenshotUtils.capturePageScreenshot(ScreenshotUtils.COMPONENTS_FOLDER + "task-analysis");
}

@Test
public void captureScreenshotUserSelectionComponent() throws IOException {
redirectToRelativeLink(userSelectionComponentShowcaseUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
import com.axonivy.portal.selenium.common.ScreenshotUtils;
import com.axonivy.portal.selenium.common.TestAccount;
import com.axonivy.portal.selenium.common.Variable;
import com.axonivy.portal.selenium.common.WaitHelper;
import com.axonivy.portal.selenium.page.ClientStatisticWidgetNewDashboardPage;
import com.axonivy.portal.selenium.page.MainMenuPage;
import com.axonivy.portal.selenium.page.NewDashboardPage;
import com.axonivy.portal.selenium.page.StatisticWidgetPage;
import com.axonivy.portal.selenium.page.TaskWidgetPage;

import ch.ivy.addon.portalkit.enums.PortalVariable;

Expand All @@ -34,53 +30,6 @@ public void setup() {
login(TestAccount.ADMIN_USER);
}

@Test
public void screenshotForStatistic() throws IOException {
showNewDashboard();
NewDashboardPage homePage = new NewDashboardPage();
homePage.waitForCaseWidgetLoaded();
MainMenuPage mainMenu = new MainMenuPage();

TaskWidgetPage taskWidgetPage = mainMenu.openTaskList();
taskWidgetPage.openTask("SupportTicket");

ScreenshotUtils.resizeBrowser(new Dimension(1460, 800));
WaitHelper.waitForNavigation(() -> redirectToRelativeLink(createTestingTasksUrl));
homePage = new NewDashboardPage();
homePage.waitForCaseWidgetLoaded();
homePage.waitForGrowlMessageDisappear();
mainMenu.expandMainMenu();

ScreenshotUtils.executeDecorateJs("highlightStatisticNavigation()");
ScreenshotUtils.capturePageScreenshot(ScreenshotUtils.STATISTIC_WIDGET_FOLDER + "navigate-to-full-statistics-page");
ScreenshotUtils.resizeBrowser(new Dimension(1386, 2210));

StatisticWidgetPage statisticWidgetPage = mainMenu.openStatisticPage();
statisticWidgetPage.switchCreateMode();
mainMenu.closeMainMenu();

statisticWidgetPage.createTaskByPriorityChart();
statisticWidgetPage.createTaskByExpiryChart();
ScreenshotUtils.captureElementScreenshot(statisticWidgetPage.waitAndGetChartCreationContainer(),
ScreenshotUtils.STATISTIC_WIDGET_FOLDER + "available-charts");

WebElement chartCreationDialog = statisticWidgetPage.getCaseByFinishedTaskCreationDialog();
ScreenshotUtils.captureElementWithMarginOptionScreenshot(chartCreationDialog,
ScreenshotUtils.STATISTIC_WIDGET_FOLDER + "chart-creation-dialog", new ScreenshotMargin(10, 10));

refreshPage();
statisticWidgetPage.waitForChartCreationPageRendered();
statisticWidgetPage.backToDashboard();
statisticWidgetPage.waitForAllChartLoaded();
ScreenshotUtils.executeDecorateJs("numberingChartPanel()");
ScreenshotUtils.captureElementWithMarginOptionScreenshot(statisticWidgetPage.waitAndGetChartPanelByIndex(1),
ScreenshotUtils.STATISTIC_WIDGET_FOLDER + "chart-detail-with-annotation", new ScreenshotMargin(20, 10));
refreshPage();
statisticWidgetPage.waitForAllChartLoaded();
ScreenshotUtils.captureElementWithMarginOptionScreenshot(statisticWidgetPage.getChartInfoDialogOfChart(1),
ScreenshotUtils.STATISTIC_WIDGET_FOLDER + "chart-info-dialog", new ScreenshotMargin(20, 10));
}

@Test
public void screenshotStatisticWidgetList() throws IOException {
showNewDashboard();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.axonivy.portal.selenium.page;

import static com.codeborne.selenide.Condition.appear;

import static com.codeborne.selenide.Condition.disappear;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.$$;
Expand Down Expand Up @@ -41,10 +40,6 @@ public ProcessWidgetPage openProcessList() {
return NavigationHelper.navigateToProcessList();
}

public StatisticWidgetPage openStatisticPage() {
return NavigationHelper.navigateToStatisticPage();
}

public void openUserSettingMenu() {
$("#top-menu").shouldBe(appear, DEFAULT_TIMEOUT);
$("a[id='user-settings-menu']").shouldBe(clickable(), DEFAULT_TIMEOUT).click();
Expand Down Expand Up @@ -92,12 +87,6 @@ public CaseWidgetPage selectCaseMenu() {
return new CaseWidgetPage();
}

public StatisticWidgetPage selectStatisticDashboard() {
WaitHelper
.waitForNavigation(() -> waitForElementClickableThenClick($(".layout-menu li[role='menuitem'] a.STATISTICS")));
return new StatisticWidgetPage();
}

private void waitForProcessesPageAfterSelectProcessesCategory() {
waitForElementDisplayed(By.id("process-widget:process-search:non-ajax-keyword-filter"), true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class NewDashboardDetailsEditPage extends TemplatePage {
public static final String PROCESS_WIDGET = "Process List";
public static final String PROCESS_VIEWER_WIDGET = "Process Viewer";
public static final String CUSTOM_WIDGET = "Custom Widget";
public static final String STATISTIC_WIDGET = "Statistic chart";
public static final String WELCOME_WIDGET = "Welcome widget";
public static final String NEWS_WIDGET = "News feed widget";
public static final String TASK_BY_PRIORITY = "Tasks by Priority";
Expand Down Expand Up @@ -161,10 +160,6 @@ public StatisticEditWidgetNewDashboardPage addNewStatisticWidget() {
return new StatisticEditWidgetNewDashboardPage();
}

public StatisticWidgetDashboardPage selectStatisticWidget() {
return new StatisticWidgetDashboardPage();
}

public SelenideElement getTitleByIndex(int index) {
return $("a[id='dashboard-title-" + index + "']");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,6 @@ public void selectDashboard(int index) {
selectDashboard.parent().shouldBe(Condition.cssClass("active-menuitem"), DEFAULT_TIMEOUT);
}

public StatisticWidgetDashboardPage selectStatisticWidget() {
return new StatisticWidgetDashboardPage();
}

public void checkDisplayedCaseWidgetContainer() {
getCaseWidgetContainer().shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}
Expand Down
Loading

0 comments on commit 817d305

Please sign in to comment.