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

Feature/ivyportal 18044 stabilize screenshot tests #1284

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5db82eb
IVYPORTAL-17855 Various or urgent requests in IVYPORTAL - S267 > IVYP…
mnhnam-axonivy Oct 31, 2024
1dee5d3
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 18, 2024
4121f4d
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 19, 2024
b77d51b
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 21, 2024
44d3f8f
master
nhthinh-axonivy Nov 21, 2024
eff77ea
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 21, 2024
17403e3
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 22, 2024
fe05a20
bug/IVYPORTAL-17918-BUG-Notification-bug-some-lines-have-no-message-a…
nhthinh-axonivy Nov 22, 2024
9cd40f4
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 22, 2024
70a8b43
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 25, 2024
e7fcc1c
master
nhthinh-axonivy Nov 25, 2024
8876db5
master
nhthinh-axonivy Nov 25, 2024
49a101e
master
nhthinh-axonivy Nov 25, 2024
c278be8
document/IVYPORTAL-17285-Update-document-for-setting-up-custom-Callab…
nhthinh-axonivy Nov 28, 2024
85d9acd
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 28, 2024
4a27883
Merge branch 'master' of https://github.com/axonivy-market/portal
nhthinh-axonivy Nov 28, 2024
6e7d787
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Nov 28, 2024
9aa34ae
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Nov 29, 2024
bb069f0
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 2, 2024
dfc98d4
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 2, 2024
ca7161b
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 2, 2024
5353e44
Merge branch 'master' of https://github.com/axonivy-market/portal int…
nhthinh-axonivy Dec 2, 2024
3b823dc
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 3, 2024
f79347a
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 3, 2024
cc90728
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 3, 2024
5b9be11
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 3, 2024
2ad1f55
Revert "feature/IVYPORTAL-18044-Stabilize-screenshot-tests"
nhthinh-axonivy Dec 5, 2024
6fd80bf
Merge branch 'master' of https://github.com/axonivy-market/portal int…
nhthinh-axonivy Dec 6, 2024
8d94fd7
feature/IVYPORTAL-18044-Stabilize-screenshot-tests
nhthinh-axonivy Dec 9, 2024
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
Expand Up @@ -40,9 +40,10 @@ public void captureScreenshotGrowlMessage() throws IOException {
updatePortalSetting(Variable.DISPLAY_MESSAGE_AFTER_FINISH_TASK.getKey(), "true");
redirectToRelativeLink(createTestingCaseContainOneTask);
ScreenshotUtils.resizeBrowser(new Dimension(1500, 1500));

redirectToNewDashBoard();
NewDashboardPage newDashboardPage = new NewDashboardPage();
WaitHelper.waitForNavigation(() -> new NewDashboardPage().startTask(0));
newDashboardPage.waitForTaskWidgetLoaded();
newDashboardPage.startTask(0);
ScreenshotUtils.resizeBrowser(new Dimension(1366, 800));
newDashboardPage = new NewDashboardPage();
newDashboardPage.waitForGrowlMessageDisplayClearly();
Expand All @@ -53,6 +54,7 @@ public void captureScreenshotGrowlMessage() throws IOException {
redirectToRelativeLink(cleanupDataLink);
updatePortalSetting(Variable.DISPLAY_MESSAGE_AFTER_FINISH_TASK.getKey(), "true");
redirectToRelativeLink(createTestingTasksUrl);
newDashboardPage = new NewDashboardPage();
WaitHelper.waitForNavigation(() -> new NewDashboardPage().startTask(1));
TaskTemplatePage taskTemplatePage = new TaskTemplatePage();
taskTemplatePage.switchToIFrameOfTask();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,11 @@ public void screenshotActionWarningDialogWhenStartTask() throws IOException {
taskWidget.filterTaskName(taskName, FilterOperator.IS);
taskWidget.applyFilter();

newDashboardPage = new NewDashboardPage();
newDashboardPage.startTask(0);
TaskTemplatePage taskIframePage = new TaskTemplatePage();
taskIframePage.switchToIFrameOfTask();
taskIframePage.clickCancelAndLeftButton();
taskIframePage.switchBackToParent();


newDashboardPage = new NewDashboardPage();
newDashboardPage.waitForTaskWidgetLoaded();
newDashboardPage.startTask(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.api.Test;
import org.openqa.selenium.Dimension;

import com.axonivy.ivy.webtest.IvyWebTest;
import com.axonivy.portal.selenium.common.NavigationHelper;
import com.axonivy.portal.selenium.common.ScreenshotBaseTest;
import com.axonivy.portal.selenium.common.ScreenshotUtils;
Expand All @@ -18,6 +19,7 @@
import com.axonivy.portal.selenium.page.NewDashboardPage;
import com.axonivy.portal.selenium.page.TopMenuTaskWidgetPage;

@IvyWebTest
public class DemoProcessesScreenshotTest extends ScreenshotBaseTest {

private static String LEAVE_REQUEST_START_LINK = "portal-user-examples/170321BD7F5539D6/start.ivp";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public void screenshotCaseDetails() throws IOException {
ScreenshotUtils.captureElementWithMarginOptionScreenshot(detailsPage.openAddAttachmentDialog(),
ScreenshotUtils.CASE_DETAIL_FOLDER + "how-to-attach-document-to-case", new ScreenshotMargin(10));
detailsPage.closeAddAttachmentDialog();

refreshPage();
detailsPage.waitForCaseDetailsDisplay();
detailsPage.uploadDocumentWithoutError(FileHelper.getAbsolutePathToTestFile("test-no-files-no-js.pdf"));

refreshPage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

public class CaseMapPage extends TaskTemplatePage {

@Override
public void waitForIFrameContentVisible() {
$("button[id='form:submit-request']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}
Expand All @@ -22,7 +23,7 @@ public void clickSubmitRequestButton() {

public void clickSubmitButtonAndBackToTaskList() {
$("button[id$='submit-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
switchBackToParent();
switchToDefaultContent();
}

public String getHeader() {
Expand Down Expand Up @@ -85,6 +86,7 @@ public SelenideElement getInternalCreditComment() {
return findElementByCssSelector("textarea[id$='internal-comment']");
}

@Override
public void inputField(String id, String value) {
$(By.id(id)).clear();
$(By.id(id)).sendKeys(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public SelenideElement getElementInPortalIFramTask(String cssSelector) {

public void clickCancelButton() {
$("a[id$='button-cancel']").shouldBe(getClickableCondition()).click();
switchToDefaultContent();
}

public void clickActionButton() {
Expand Down Expand Up @@ -251,7 +252,8 @@ public void clickCreateGroupChatBtn() {
}

public void clickCancelAndLeftButton() {
waitForElementClickableThenClick("a[id$='button-cancel']");
clickByJavaScript($(By.linkText("Cancel")));
switchBackToParent();
}

public int countSideSteps() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public void testShowTaskStatusBannerOnTaskDetails() {
taskWidget.startTask(0);
redirectToNewDashBoard();
NavigationHelper.navigateToTaskList();
taskWidget = new TopMenuTaskWidgetPage();
taskWidget.openFilterWidget();
taskWidget.removeFilter(0);
taskWidget.applyFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,6 @@ public IvyTaskResultDTO analyzeTaskCategoryStatistic(TaskSearchCriteria criteria
});
}

// private TaskCategoryStatistic createTaskCategoryStatistic(Recordset recordSet) {
// TaskCategoryStatistic taskCategoryStatistic = new TaskCategoryStatistic();
// taskCategoryStatistic.setNumberOfTasksByCategory(new HashMap<>());
// if (recordSet != null) {
// recordSet.getRecords().forEach(record -> {
// long numberOfTasks = ((Number)(record.getField("COUNT"))).longValue();
// taskCategoryStatistic.getNumberOfTasksByCategory().put(record.getField("CATEGORY").toString(), numberOfTasks);
// });
// }
// return taskCategoryStatistic;
// }

private ExpiryStatistic createExpiryTimeStampToCountMap(Recordset recordSet) throws ParseException {
ExpiryStatistic expiryStatistic = new ExpiryStatistic();
Map<Date, Long> numberOfTasksByExpiryTime = new HashMap<>();
Expand Down
Loading