public function PermissionsByTermContext::iShouldSeeTextAfterAWhile in Permissions by Term 8
@Then /^I should see text matching "([^"]*)" after a while$/
File
- tests/
src/ Behat/ Context/ PermissionsByTermContext.php, line 220
Class
- PermissionsByTermContext
- Class PermissionsByTermContext
Namespace
Drupal\Tests\permissions_by_term\Behat\ContextCode
public function iShouldSeeTextAfterAWhile($text) {
try {
$startTime = time();
do {
$content = $this
->getSession()
->getPage()
->getText();
if (substr_count($content, $text) > 0) {
return true;
}
} while (time() - $startTime < self::MAX_DURATION_SECONDS);
throw new ResponseTextException(sprintf('Could not find text %s after %s seconds', $text, self::MAX_DURATION_SECONDS), $this
->getSession());
} catch (StaleElementReference $e) {
return true;
}
}