You are here

public function DisplayTest::testAddDisplay in Drupal 9

Same name in this branch
  1. 9 core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testAddDisplay()
  2. 9 core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAddDisplay()
Same name and namespace in other branches
  1. 8 core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAddDisplay()

Tests adding a display.

File

core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php, line 62

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

public function testAddDisplay() {
  $this
    ->drupalGet('admin/structure/views/view/test_content_ajax');
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->find('css', '#views-display-menu-tabs .add')
    ->click();

  // Wait for the animation to complete.
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();

  // Add the display.
  $page
    ->find('css', '#edit-displays-top-add-display-block')
    ->click();
  $element = $page
    ->findById('views-display-menu-tabs')
    ->findLink('Block');
  $this
    ->assertNotEmpty($element);
}