public function BlockTest::testSearchFormsSearchOnCorrectPage in Search API Pages 8
Tests search forms search on the correct page when multiple configured.
File
- tests/
src/ Functional/ BlockTest.php, line 100
Class
- BlockTest
- Provides web tests for Search API Pages.
Namespace
Drupal\Tests\search_api_page\FunctionalCode
public function testSearchFormsSearchOnCorrectPage() {
$forms = $this
->getSession()
->getPage()
->findAll('css', '.search-form form');
$form = end($forms);
$form
->fillField('Search', 'Owls');
$form
->submit();
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertPath('other_search/Owls');
$this
->assertSession()
->pageTextContains('9 results found');
}