$theme_config->
save();
} /**
* Tests click on links to show messages and remove messages.
*/
public function testAddRemoveMessages() { $web_assert =
$this->
assertSession();
$this->
drupalGet('js_message_test_link'
);
$current_messages =
[];
foreach (JSMessageTestController::
getMessagesSelectors() as $messagesSelector) { $web_assert->
elementExists('css',
$messagesSelector);
foreach (JSMessageTestController::
getTypes() as $type) { $this->
click('[id="add-' .
$messagesSelector . '-' .
$type . '"]'
);
$selector = "
$messagesSelector .messages.messages--
$type";
$msg_element =
$web_assert->
waitForElementVisible('css',
$selector);
$this->
assertNotEmpty($msg_element, "Message element visible:
$selector"
);
$web_assert->
elementContains('css',
$selector, "This is a message of the type,
$type. You be the judge of its importance."
);
$current_messages[$selector] = "This is a message of the type,
$type. You be the judge of its importance.";
$this->
assertCurrentMessages($current_messages,
$messagesSelector);
} // Remove messages 1 by 1 and confirm the messages are expected.