You are here

protected function DynamicEntityReferenceTest::selectAutocompleteOption in Dynamic Entity Reference 8

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/DynamicEntityReferenceTest.php \Drupal\Tests\dynamic_entity_reference\FunctionalJavascript\DynamicEntityReferenceTest::selectAutocompleteOption()

Selects the autocomplete result with the given delta.

Parameters

int $delta: Delta of item to select. Starts from 0.

1 call to DynamicEntityReferenceTest::selectAutocompleteOption()
DynamicEntityReferenceTest::testFieldSettings in tests/src/FunctionalJavascript/DynamicEntityReferenceTest.php
Tests field settings of dynamic entity reference field.

File

tests/src/FunctionalJavascript/DynamicEntityReferenceTest.php, line 299

Class

DynamicEntityReferenceTest
Ensures that Dynamic Entity References field works correctly.

Namespace

Drupal\Tests\dynamic_entity_reference\FunctionalJavascript

Code

protected function selectAutocompleteOption($delta = 0) {

  // Press the down arrow to select the nth option.

  /** @var \Behat\Mink\Element\NodeElement $element */
  $element = $this
    ->getSession()
    ->getPage()
    ->findAll('css', '.ui-autocomplete.ui-menu li.ui-menu-item')[$delta];
  $element
    ->click();
}