function EntityReferenceAutocompleteWidgetTest::doAutocomplete
Same name in other branches
- 9 core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php \Drupal\FunctionalJavascriptTests\EntityReference\EntityReferenceAutocompleteWidgetTest::doAutocomplete()
- 8.9.x core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php \Drupal\FunctionalJavascriptTests\EntityReference\EntityReferenceAutocompleteWidgetTest::doAutocomplete()
- 10 core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php \Drupal\FunctionalJavascriptTests\EntityReference\EntityReferenceAutocompleteWidgetTest::doAutocomplete()
Executes an autocomplete on a given field and waits for it to finish.
Parameters
string $field_name: The field name.
1 call to EntityReferenceAutocompleteWidgetTest::doAutocomplete()
- EntityReferenceAutocompleteWidgetTest::testEntityReferenceAutocompleteWidget in core/
tests/ Drupal/ FunctionalJavascriptTests/ EntityReference/ EntityReferenceAutocompleteWidgetTest.php - Tests that the default autocomplete widget return the correct results.
File
-
core/
tests/ Drupal/ FunctionalJavascriptTests/ EntityReference/ EntityReferenceAutocompleteWidgetTest.php, line 210
Class
- EntityReferenceAutocompleteWidgetTest
- Tests the output of entity reference autocomplete widgets.
Namespace
Drupal\FunctionalJavascriptTests\EntityReferenceCode
protected function doAutocomplete($field_name) : void {
$autocomplete_field = $this->getSession()
->getPage()
->findField($field_name . '[0][target_id]');
$autocomplete_field->setValue('Test');
$this->getSession()
->getDriver()
->keyDown($autocomplete_field->getXpath(), ' ');
$this->assertSession()
->waitOnAutocomplete();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.