Bug 4339: Trying to fix selenium tests regarding RaceBoard settings. It

seems not all WebDriver implementations support the command "rect" yet.
This commit is contained in:
Steffen Schaefer committed 2018-07-19 16:47:08 +02:00
1 parent 663a07121e
commit 822b35d516
1 file changed
+12 -1
@@ -3,6 +3,7 @@ package com.sap.sailing.selenium.pages.raceboard;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.function.BooleanSupplier;
import java.util.function.Function;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
@@ -44,7 +45,17 @@ public class RaceBoardPage extends HostPageWithAuthentication {
super(driver);
}
public MapSettingsPO openMapSettings() {
new WebDriverWait(driver, 20000).until(p -> raceMapSettingsButton.getRect().y > 100);
new WebDriverWait(driver, 30).until(new Function<WebDriver, Boolean>() {
@Override
public Boolean apply(WebDriver p) {
try {
return raceMapSettingsButton.isDisplayed() && raceMapSettingsButton.getLocation().y > 100;
} catch (Exception e) {
// RaceMap cause multiple reflows and the element may temporarily not be in the viewport
return false;
}
}
});
raceMapSettingsButton.click();
waitUntil(new BooleanSupplier() {