protected function SiteAlertWebDriverTestBase::assertSiteAlertAppears in Site Alert 8
Checks that the alert with the given message appears on the page.
Parameters
string $message: The message contained in the alert that is expected to appear.
2 calls to SiteAlertWebDriverTestBase::assertSiteAlertAppears()
- SiteAlertCacheWorkaroundTest::testPageCacheWorkaround in tests/
src/ FunctionalJavascript/ SiteAlertCacheWorkaroundTest.php - Tests that the workaround to display alerts on cached pages works.
- SiteAlertTimeoutTest::testSiteAlertTimeouts in tests/
src/ FunctionalJavascript/ SiteAlertTimeoutTest.php - Tests the automatic refreshing of site alerts.
File
- tests/
src/ FunctionalJavascript/ SiteAlertWebDriverTestBase.php, line 43
Class
- SiteAlertWebDriverTestBase
- Base class for functional JS tests for the Site Alerts module.
Namespace
Drupal\Tests\site_alert\FunctionalJavascriptCode
protected function assertSiteAlertAppears($message) {
$condition = 'jQuery(\'.site-alert div.text:contains("' . $message . '")\').length > 0;';
$this
->assertJsCondition($condition);
}