You are here

protected function IntegrationTest::enableSearch in Search API Autocomplete 8

Goes to the index's "Autocomplete" tab and creates/enables the test search.

1 call to IntegrationTest::enableSearch()
IntegrationTest::testModule in tests/src/FunctionalJavascript/IntegrationTest.php
Tests the complete functionality of the module via the UI.

File

tests/src/FunctionalJavascript/IntegrationTest.php, line 99

Class

IntegrationTest
Tests the functionality of the whole module from a user's perspective.

Namespace

Drupal\Tests\search_api_autocomplete\FunctionalJavascript

Code

protected function enableSearch() {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet($this
    ->getAdminPath());

  // Check whether all expected groups and searches are present.
  $assert_session
    ->pageTextContains('Search views');
  $assert_session
    ->pageTextContains('Searches provided by Views');
  $assert_session
    ->pageTextContains('Search API Autocomplete Test view');
  $assert_session
    ->pageTextContains('Test search');
  $assert_session
    ->pageTextContains('Autocomplete test module search');

  // Enable all Views searches (just one).
  $assert_session
    ->checkboxNotChecked("searches[{$this->searchId}]");
  $this
    ->click('table[data-drupal-selector="edit-search-views-searches"] > thead > tr > th.select-all input.form-checkbox');
  $assert_session
    ->checkboxChecked("searches[{$this->searchId}]");
  $this
    ->click('[data-drupal-selector="edit-actions-submit"]');
  $this
    ->logPageChange(NULL, 'POST');
  $assert_session
    ->pageTextContains('The settings have been saved. Please remember to set the permissions for the newly enabled searches.');
}