You are here

private function AddLayoutTest::addSectionAfter in Layout builder library 8

Clicks the "Add section" button after an existing section.

Parameters

int $index: (optional) The index of the existing session. Defaults to 0.

1 call to AddLayoutTest::addSectionAfter()
AddLayoutTest::testAddLayout in tests/src/Functional/AddLayoutTest.php
Tests adding a layout to the library.

File

tests/src/Functional/AddLayoutTest.php, line 114

Class

AddLayoutTest
Tests adding a layout to the library.

Namespace

Drupal\Tests\layout_library\Functional

Code

private function addSectionAfter($index = 0) {
  $add_links = $this
    ->getSession()
    ->getPage()
    ->findAll('named', [
    'link',
    'Add section',
  ]);
  $this
    ->assertGreaterThan($index, count($add_links));
  $add_links[$index]
    ->click();
}