You are here

private function LayoutBuilderTest::openAddBlockForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::openAddBlockForm()
  2. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::openAddBlockForm()

Opens the add block form in the off-canvas dialog.

Parameters

string $block_title: The block title which will be the link text.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php, line 472

Class

LayoutBuilderTest
Tests the Layout Builder UI.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

private function openAddBlockForm($block_title) {
  $assert_session = $this
    ->assertSession();
  $assert_session
    ->linkExists('Add block');
  $this
    ->clickLink('Add block');
  $assert_session
    ->assertWaitOnAjaxRequest();
  $this
    ->assertNotEmpty($assert_session
    ->waitForElementVisible('named', [
    'link',
    $block_title,
  ]));
  $this
    ->clickLink($block_title);
  $this
    ->assertOffCanvasFormAfterWait('layout_builder_add_block');
}