You are here

protected function LayoutBuilderDisableInteractionsTest::assertLinksFormIframeNotInteractive in Drupal 9

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

Asserts that forms, links, and iframes in preview are non-interactive.

1 call to LayoutBuilderDisableInteractionsTest::assertLinksFormIframeNotInteractive()
LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
Tests that forms and links are disabled in the Layout Builder preview.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php, line 191

Class

LayoutBuilderDisableInteractionsTest
Tests the Layout Builder disables interactions of rendered blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function assertLinksFormIframeNotInteractive() {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->assertNotEmpty($assert_session
    ->waitForElement('css', '.block-search'));
  $searchButton = $assert_session
    ->buttonExists('Search');
  $this
    ->assertElementUnclickable($searchButton);
  $assert_session
    ->linkExists('Take me away');
  $this
    ->assertElementUnclickable($page
    ->findLink('Take me away'));
  $iframe = $assert_session
    ->elementExists('css', '#iframe-that-should-be-disabled');
  $this
    ->assertElementUnclickable($iframe);
}