You are here

protected function MessageCommandTest::assertAnnounceContains in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php \Drupal\FunctionalJavascriptTests\Ajax\MessageCommandTest::assertAnnounceContains()

Checks for inclusion of text in #drupal-live-announce.

Parameters

string $expected_message: The text expected to be present in #drupal-live-announce.

1 call to MessageCommandTest::assertAnnounceContains()
MessageCommandTest::testMessageCommand in core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
Test AJAX MessageCommand use in a form.

File

core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php, line 113

Class

MessageCommandTest
Tests adding messages via AJAX command.

Namespace

Drupal\FunctionalJavascriptTests\Ajax

Code

protected function assertAnnounceContains($expected_message) {
  $assert_session = $this
    ->assertSession();
  $this
    ->assertNotEmpty($assert_session
    ->waitForElement('css', "#drupal-live-announce:contains('{$expected_message}')"));
}