Add the timeout in NoSuchElementException messages
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
ff7d1bf1e7
commit
a7e1833cf3
|
@ -139,7 +139,11 @@ class Actor {
|
|||
return $element !== null;
|
||||
};
|
||||
if (!Utils::waitFor($findCallback, $timeout, $timeoutStep)) {
|
||||
throw new NoSuchElementException($elementLocator->getDescription() . " could not be found");
|
||||
$message = $elementLocator->getDescription() . " could not be found";
|
||||
if ($timeout > 0) {
|
||||
$message = $message . " after $timeout seconds";
|
||||
}
|
||||
throw new NoSuchElementException($message);
|
||||
}
|
||||
|
||||
return $element;
|
||||
|
@ -177,6 +181,9 @@ class Actor {
|
|||
// exception in the chain.
|
||||
$message = $exception->getMessage() . "\n" .
|
||||
$elementLocator->getDescription() . " could not be found";
|
||||
if ($timeout > 0) {
|
||||
$message = $message . " after $timeout seconds";
|
||||
}
|
||||
throw new NoSuchElementException($message, $exception);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue