function CommandsTest::assertWaitPageContains
Same name in other branches
- 9 core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php \Drupal\FunctionalJavascriptTests\Ajax\CommandsTest::assertWaitPageContains()
- 8.9.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php \Drupal\FunctionalJavascriptTests\Ajax\CommandsTest::assertWaitPageContains()
- 11.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php \Drupal\FunctionalJavascriptTests\Ajax\CommandsTest::assertWaitPageContains()
Asserts that page contains a text after waiting.
@internal
Parameters
string $text: A needle text.
2 calls to CommandsTest::assertWaitPageContains()
- CommandsTest::testAjaxCommands in core/
tests/ Drupal/ FunctionalJavascriptTests/ Ajax/ CommandsTest.php - Tests the various Ajax Commands.
- CommandsTest::testLegacyAjaxCommands in core/
tests/ Drupal/ FunctionalJavascriptTests/ Ajax/ CommandsTest.php - Tests the various Ajax Commands with legacy parameters. @group legacy
File
-
core/
tests/ Drupal/ FunctionalJavascriptTests/ Ajax/ CommandsTest.php, line 174
Class
- CommandsTest
- Performs tests on AJAX framework commands.
Namespace
Drupal\FunctionalJavascriptTests\AjaxCode
protected function assertWaitPageContains(string $text) : void {
$page = $this->getSession()
->getPage();
$page->waitFor(10, function () use ($page, $text) {
return stripos($page->getContent(), $text) !== FALSE;
});
$this->assertStringContainsString($text, $page->getContent());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.