You are here

protected function IntegrationTestBase::getElementText in Search API Autocomplete 8

Retrieves the text contents of a descendant of the given element.

Parameters

\Behat\Mink\Element\NodeElement $element: The element.

string $css_selector: The CSS selector defining the descendant to look for.

Return value

string|null The text contents of the descendant, or NULL if it couldn't be found.

3 calls to IntegrationTestBase::getElementText()
IntegrationTest::checkLiveResultsAutocomplete in tests/src/FunctionalJavascript/IntegrationTest.php
Tests autocomplete with the "Live results" suggester.
IntegrationTest::checkSearchAutocomplete in tests/src/FunctionalJavascript/IntegrationTest.php
Tests autocompletion in the search form.
PagesIntegrationTest::checkAutocompleteFunctionality in tests/src/FunctionalJavascript/PagesIntegrationTest.php
Checks that autocomplete works correctly.

File

tests/src/FunctionalJavascript/IntegrationTestBase.php, line 71

Class

IntegrationTestBase
Provides a base class for integration tests of this module.

Namespace

Drupal\Tests\search_api_autocomplete\FunctionalJavascript

Code

protected function getElementText(NodeElement $element, $css_selector) {
  $element = $element
    ->find('css', $css_selector);
  return $element ? $element
    ->getText() : NULL;
}