function PreviewTest::assertPreviewAJAX

Same name in other branches
  1. 8.9.x core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php \Drupal\Tests\views_ui\FunctionalJavascript\PreviewTest::assertPreviewAJAX()
  2. 10 core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php \Drupal\Tests\views_ui\FunctionalJavascript\PreviewTest::assertPreviewAJAX()
  3. 11.x core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php \Drupal\Tests\views_ui\FunctionalJavascript\PreviewTest::assertPreviewAJAX()

Assert that the preview contains expected data.

@internal

Parameters

int $row_count: The expected number of rows in the preview.

2 calls to PreviewTest::assertPreviewAJAX()
PreviewTest::clickPreviewLinkAJAX in core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
Click on a preview link.
PreviewTest::getPreviewAJAX in core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
Get the preview form and force an AJAX preview update.

File

core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php, line 289

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

protected function assertPreviewAJAX(int $row_count) : void {
    $elements = $this->getSession()
        ->getPage()
        ->findAll('css', '#views-live-preview .views-row');
    $this->assertCount($row_count, $elements, 'Expected items found on page.');
}

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