You are here

protected function PreviewTest::getPreviewAJAX in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php \Drupal\Tests\views_ui\FunctionalJavascript\PreviewTest::getPreviewAJAX()

Get the preview form and force an AJAX preview update.

Parameters

string $view_name: The view to test.

string $panel_id: The view panel to test.

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

3 calls to PreviewTest::getPreviewAJAX()
PreviewTest::testPreviewSortLink in core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
Tests the link to sort in the preview form.
PreviewTest::testPreviewWithPagersUI in core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
Tests pagers in the preview form.
PreviewTest::testTaxonomyAJAX in core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
Tests the taxonomy term preview AJAX.

File

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

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

protected function getPreviewAJAX($view_name, $panel_id, $row_count) {
  $this
    ->drupalGet('admin/structure/views/view/' . $view_name . '/edit/' . $panel_id);
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Update preview');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertPreviewAJAX($row_count);
}