/**
* Tests that updating the text field trigger an AJAX request/response.
*
* @see \Drupal\system\Tests\Ajax\ElementValidationTest::testAjaxElementValidation()
*/
public function testAjaxElementValidation() { $this->
drupalGet('ajax_validation_test'
);
// Changing the value of the textfield will trigger an AJAX
// request/response.
$field =
$this->
getSession()->
getPage()->
findField('drivertext'
);
$field->
setValue('some dumb text'
);
$field->
blur();
// When the AJAX command updates the DOM a <ul> unsorted list
// "message__list" structure will appear on the page echoing back the
// "some dumb text" message.
$placeholder =
$this->
assertSession()->
waitForElement('css', "[aria-label='Status message'] > ul > li > em:contains('some dumb text')"
);
$this->
assertNotNull($placeholder, 'Message structure containing input data located.'
);
}}