function NavigationBlockUiTest::openAddBlockForm

Same name in other branches
  1. 10 core/modules/navigation/tests/src/FunctionalJavascript/NavigationBlockUiTest.php \Drupal\Tests\navigation\FunctionalJavascript\NavigationBlockUiTest::openAddBlockForm()

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

@todo move this from into a trait from \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest

Parameters

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

1 call to NavigationBlockUiTest::openAddBlockForm()
NavigationBlockUiTest::testNavigationBlockAdminUiPage in core/modules/navigation/tests/src/FunctionalJavascript/NavigationBlockUiTest.php
Tests navigation block admin page exists and functions correctly.

File

core/modules/navigation/tests/src/FunctionalJavascript/NavigationBlockUiTest.php, line 168

Class

NavigationBlockUiTest
Tests that the navigation block UI exists and stores data correctly.

Namespace

Drupal\Tests\navigation\FunctionalJavascript

Code

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

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