mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-browsers: move waitWithNewTime from OpenViduTestappUser to BrowserUser
parent
e5f87f58e8
commit
fe0869e9fe
|
@ -17,8 +17,12 @@
|
||||||
|
|
||||||
package io.openvidu.test.browsers;
|
package io.openvidu.test.browsers;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
|
||||||
import org.openqa.selenium.Dimension;
|
import org.openqa.selenium.Dimension;
|
||||||
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;
|
||||||
|
|
||||||
|
@ -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() {
|
public void dispose() {
|
||||||
this.driver.quit();
|
this.driver.quit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,4 @@ public class OpenViduTestappUser {
|
||||||
this.browserUser.dispose();
|
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue