diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskIFrameTemplatePage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskIFrameTemplatePage.java index 208d9023cb..739567137f 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskIFrameTemplatePage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TaskIFrameTemplatePage.java @@ -216,14 +216,19 @@ public void startSideStep() { } public void inputValue(String employee, String from, String to, String representation) { - $(By.id("leave-request:fullname")).shouldBe(Condition.appear).shouldBe(Condition.editable).sendKeys(employee); - $(By.id("leave-request:substitute")).sendKeys(representation); - $(By.id("leave-request:from_input")).sendKeys(from); - $(By.id("leave-request:to_input")).sendKeys(to); - } - - public void inputField(String cssSelector, String value) { - $(cssSelector).shouldBe(Condition.appear).shouldBe(Condition.editable).sendKeys(value); + SelenideElement fullNameElement = + $(By.id("leave-request:fullname")).shouldBe(Condition.appear).shouldBe(Condition.editable); + fullNameElement.click(); + fullNameElement.sendKeys(employee); + SelenideElement representationElement = $(By.id("leave-request:substitute")); + representationElement.click(); + representationElement.sendKeys(representation); + SelenideElement fromElement = $(By.id("leave-request:from_input")); + fromElement.click(); + fromElement.sendKeys(from); + SelenideElement toElement = $(By.id("leave-request:to_input")); + toElement.click(); + toElement.sendKeys(to); } public NewDashboardPage clickSubmitButton() { diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TemplatePage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TemplatePage.java index 952b993f09..85b6c840b7 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TemplatePage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/TemplatePage.java @@ -35,7 +35,6 @@ import com.codeborne.selenide.WebDriverConditions; import com.codeborne.selenide.WebDriverRunner; import com.codeborne.selenide.WebElementCondition; -import com.codeborne.selenide.conditions.Not; public abstract class TemplatePage extends AbstractPage { private static final int IFRAME_SCREENSHOT_FILE_SIZE_AT_MINIMUM = 10000; @@ -541,4 +540,11 @@ public QRCodePage openQRCode() { $("[id='mobile-app-item']").shouldBe(appear, DEFAULT_TIMEOUT).click(); return new QRCodePage(); } + + public void sendKeys(String cssSelector, String value) { + SelenideElement element = $(cssSelector).shouldBe(Condition.appear).shouldBe(Condition.editable); + element.click(); + element.clear(); + element.sendKeys(value); + } } diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/BackNavigationTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/BackNavigationTest.java index c651ccb316..f29f2313f3 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/BackNavigationTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/BackNavigationTest.java @@ -135,9 +135,9 @@ public void testNavigateAfterFinishedTaskToCaseDetails() { taskDetailsPage = caseDetailsPage.openTasksOfCasePage(PAYMENT_TASK_NAME); TaskIFrameTemplatePage taskTemplatePage = taskDetailsPage.clickStartTask(); - taskTemplatePage.inputField("[id$='payment-request:fullname']", "Demo"); + taskTemplatePage.sendKeys("[id$='payment-request:fullname']", "Demo"); String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateTimePattern.DATE_TIME_PATTERN)); - taskTemplatePage.inputField("[id$='payment-request:from_input']", today); + taskTemplatePage.sendKeys("[id$='payment-request:from_input']", today); taskTemplatePage.clickOnSubmitButton(); caseDetailsPage = new CaseDetailsPage(); diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardTaskWidgetFilterTest.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardTaskWidgetFilterTest.java index 538c14dcdd..b522f4b3a0 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardTaskWidgetFilterTest.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/test/dashboard/DashboardTaskWidgetFilterTest.java @@ -192,7 +192,7 @@ public void testFilterDateOnCustomFields() { taskWidget = newDashboardPage.selectTaskWidget(YOUR_TASK_WIDGET); taskWidget.openFilterWidget(); taskWidget.addFilter("Shipment date", FilterOperator.BETWEEN); - taskWidget.inputValueOnLatestFilter(FilterValueType.DATE_BETWEEN, "01/01/2024","12/12/2024"); + taskWidget.inputValueOnLatestFilter(FilterValueType.DATE_BETWEEN, "01/01/2024", "12/12/2124"); taskWidget.clickOnWidgetFilterHeader(); taskWidget.applyFilter(); taskWidget.countAllTasks().shouldHave(CollectionCondition.size(2));