openvidu-test-browsers: allow WebDriverWait until with new time

pull/570/head
pabloFuente 2020-11-27 13:41:28 +01:00
parent b369e3ba7a
commit 66829bbe4a
1 changed files with 10 additions and 0 deletions

View File

@ -17,7 +17,11 @@
package io.openvidu.test.browsers; package io.openvidu.test.browsers;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -64,4 +68,10 @@ public class BrowserUser {
this.driver.quit(); this.driver.quit();
} }
public void waitWithNewTime(int newWaitTime, ExpectedCondition<Boolean> condition) {
this.waiter.withTimeout(Duration.of(newWaitTime, ChronoUnit.SECONDS));
this.waiter.until(condition);
this.waiter.withTimeout(Duration.of(this.timeOfWaitInSeconds, ChronoUnit.SECONDS));
}
} }