mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
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:
1 parent
663a07121e
commit
822b35d516
1 file changed
+12
-1
+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() {
|
||||
|
||||
|
||||
Reference in new issue
Block a user