// Specific case: send commands
if (expectedHandlerFlow != null
&& Arrays.asList(expectedHandlerFlow).contains(
HANDLER_ON_CONTENT_COMMAND)) {
// Wait the video to be started (TIMEOUT seconds at the most)
(new WebDriverWait(driver, timeout))
.until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
return d.findElement(By.id("status"))
.getAttribute("value").startsWith("play");
}
});
driver.findElement(By.id("sendCommands")).click();
}
// Wait test result, watching field "status" (TIMEOUT seconds at the
// most)
try {
(new WebDriverWait(driver, timeout))
.until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
return d.findElement(By.id("status"))
.getAttribute("value").startsWith("end");