openvidu-test-browsers: move waitWithNewTime from OpenViduTestappUser to BrowserUser

pull/669/head
pabloFuente 2021-11-10 15:24:30 +01:00
parent e5f87f58e8
commit fe0869e9fe
2 changed files with 10 additions and 6 deletions

View File

@ -17,8 +17,12 @@
package io.openvidu.test.browsers;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.LoggerFactory;
@ -67,6 +71,12 @@ public class BrowserUser {
}
}
public void waitWithNewTime(int newWaitTime, ExpectedCondition<?> condition) {
this.waiter.withTimeout(Duration.of(newWaitTime, ChronoUnit.SECONDS));
this.waiter.until(condition);
this.waiter.withTimeout(Duration.of(this.getTimeOfWait(), ChronoUnit.SECONDS));
}
public void dispose() {
this.driver.quit();
}

View File

@ -40,10 +40,4 @@ public class OpenViduTestappUser {
this.browserUser.dispose();
}
public void waitWithNewTime(int newWaitTime, ExpectedCondition<?> condition) {
this.getWaiter().withTimeout(Duration.of(newWaitTime, ChronoUnit.SECONDS));
this.getWaiter().until(condition);
this.getWaiter().withTimeout(Duration.of(this.browserUser.getTimeOfWait(), ChronoUnit.SECONDS));
}
}