You are here

public function BlockTest::testSearchForm in Search API Pages 8

Tests that the search form block works.

File

tests/src/Functional/BlockTest.php, line 76

Class

BlockTest
Provides web tests for Search API Pages.

Namespace

Drupal\Tests\search_api_page\Functional

Code

public function testSearchForm() {
  $form = $this
    ->getSession()
    ->getPage()
    ->find('css', '.search-form form');
  $form
    ->fillField('Search', 'Owls');
  $form
    ->submit();
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertPath('search/Owls');
  $this
    ->assertSession()
    ->pageTextContains('9 results found');
}