From ef065feff79a1dbc65c5465c1400c4113c6194f6 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Wed, 15 Apr 2020 02:49:11 +0200 Subject: [PATCH] bug5178: adding necessary wait for new removal alert dialog --- .../com/sap/sailing/selenium/pages/PageObject.java | 11 +++++------ .../adminconsole/tracking/TrackedRacesListPO.java | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/PageObject.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/PageObject.java index a9c8bbe39a9..0358bfe5374 100644 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/PageObject.java +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/PageObject.java @@ -304,8 +304,8 @@ public class PageObject { * @return * The first matching element in the given context. */ - protected WebElement waitForElementBySeleniumId(SearchContext context, String id, int timeout) { - FluentWait wait = createFluentWait(context, timeout, DEFAULT_POLLING_INTERVAL); + protected WebElement waitForElementBySeleniumId(SearchContext context, String id, int timeoutInSeconds) { + FluentWait wait = createFluentWait(context, timeoutInSeconds, DEFAULT_POLLING_INTERVAL); return (WebElement) wait.until(new Function() { @Override public Object apply(SearchContext context) { @@ -514,13 +514,13 @@ public class PageObject { * * @param supplier {@link PageAreaSupplier} used to instantiate the {@link PageArea} * @param seleniumId the selenium id of the desired element - * @param timeout the timeout in seconds to wait for the element + * @param timeoutInSeconds the timeout in seconds to wait for the element * @return {@link PageArea} representing the first matching element * * @see #findElementBySeleniumId(SearchContext, String) */ - protected T waitForPO(PageAreaSupplier supplier, String seleniumId, int timeout) { - return supplier.get(driver, waitForElementBySeleniumId(driver, seleniumId, timeout)); + protected T waitForPO(PageAreaSupplier supplier, String seleniumId, int timeoutInSeconds) { + return supplier.get(driver, waitForElementBySeleniumId(driver, seleniumId, timeoutInSeconds)); } /** @@ -626,7 +626,6 @@ public class PageObject { protected void waitForNotificationAndDismiss(int timeoutInSeconds, String expectedNotificationMessage) { WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds); wait.until(new Function() { - @Override public Boolean apply(WebDriver t) { boolean clickedNotifications = false; diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/adminconsole/tracking/TrackedRacesListPO.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/adminconsole/tracking/TrackedRacesListPO.java index 9972ed74199..da712b1204a 100644 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/adminconsole/tracking/TrackedRacesListPO.java +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/adminconsole/tracking/TrackedRacesListPO.java @@ -174,6 +174,7 @@ public class TrackedRacesListPO extends PageArea { private void removeSelectedTrackedRacesAndWaitForAjaxRequests() { this.removeButton.click(); + this.waitForAlertAndAccept(); waitForAjaxRequests(); }