条件の待機中にタイムアウトになると、非常に役に立たないメッセージが表示されます。
Tests in error:
myTestName(mySuiteName): Timed out after 10 seconds waiting for
com.mycompany.qa.core.SeleniumWebTesting$$anon$1@6818c458
Scalaコードは次のとおりです。
def pageContains(locatorType: String, content: String) {
locatorType match {
case "TagName" =>
val tag = new WebDriverWait(driver, defaultWait).until(
new ExpectedCondition[Boolean] {
// it times out on this line below, but I can't send out any assert failure or useful message
override def apply(driver: WebDriver) = driver.findElement(By.tagName(content)).isDisplayed
}
)
case _ =>
throw new UnsupportedOperationException("No valid locator strategy received (try a valid one, like class name)")
}
}