function GlossaryViewTest::testGlossaryDefault

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::testGlossaryDefault()
  2. 8.9.x core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::testGlossaryDefault()
  3. 11.x core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::testGlossaryDefault()

Tests the AJAX callbacks for the glossary view.

File

core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php, line 85

Class

GlossaryViewTest
Tests the basic AJAX functionality of the Glossary View.

Namespace

Drupal\Tests\views\FunctionalJavascript

Code

public function testGlossaryDefault() : void {
  // Visit the default Glossary page.
  $url = Url::fromRoute('view.test_glossary.page_1');
  $this->drupalGet($url);
  $session = $this->getSession();
  $web_assert = $this->assertSession();
  $page = $session->getPage();
  $rows = $page->findAll('css', '.view-test-glossary tr');
  // We expect 2 rows plus the header row.
  $this->assertCount(3, $rows);
  // Click on the P link, this should show 4 rows plus the header row.
  $page->clickLink('P');
  $web_assert->assertWaitOnAjaxRequest();
  $rows = $page->findAll('css', '.view-test-glossary tr');
  $this->assertCount(5, $rows);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.