function LayoutBuilderTest::assertOffCanvasFormAfterWait

Same name in other branches
  1. 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::assertOffCanvasFormAfterWait()
  2. 10 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::assertOffCanvasFormAfterWait()
  3. 11.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::assertOffCanvasFormAfterWait()

Waits for the specified form and returns it when available and visible.

Parameters

string $expected_form_id: The expected form ID.

3 calls to LayoutBuilderTest::assertOffCanvasFormAfterWait()
LayoutBuilderTest::openAddBlockForm in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
Opens the add block form in the off-canvas dialog.
LayoutBuilderTest::testConfigurableLayoutSections in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
Tests configurable layouts.
LayoutBuilderTest::testLayoutBuilderUi in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
Tests the Layout Builder UI.

File

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

Class

LayoutBuilderTest
Tests the Layout Builder UI.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

private function assertOffCanvasFormAfterWait(string $expected_form_id) : void {
    $this->assertSession()
        ->assertWaitOnAjaxRequest();
    $this->waitForOffCanvasArea();
    $off_canvas = $this->assertSession()
        ->elementExists('css', '#drupal-off-canvas');
    $this->assertNotNull($off_canvas);
    $form_id_element = $off_canvas->find('hidden_field_selector', [
        'hidden_field',
        'form_id',
    ]);
    // Ensure the form ID has the correct value and that the form is visible.
    $this->assertNotEmpty($form_id_element);
    $this->assertSame($expected_form_id, $form_id_element->getValue());
    $this->assertTrue($form_id_element->getParent()
        ->isVisible());
}

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