function LayoutBuilderDisableInteractionsTest::assertElementUnclickable
Same name in other branches
- 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest::assertElementUnclickable()
Checks if element is unclickable.
@internal
Parameters
\Behat\Mink\Element\NodeElement $element: Element being checked for.
1 call to LayoutBuilderDisableInteractionsTest::assertElementUnclickable()
- LayoutBuilderDisableInteractionsTest::assertLinksFormIframeNotInteractive in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderDisableInteractionsTest.php - Asserts that forms, links, and iframes in preview are non-interactive.
File
-
core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderDisableInteractionsTest.php, line 184
Class
- LayoutBuilderDisableInteractionsTest
- Tests the Layout Builder disables interactions of rendered blocks.
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
protected function assertElementUnclickable(NodeElement $element) : void {
try {
$element->click();
$tag_name = $element->getTagName();
$this->fail(new FormattableMarkup("@tag_name was clickable when it shouldn't have been", [
'@tag_name' => $tag_name,
]));
} catch (\Exception $e) {
$this->assertTrue(JSWebAssert::isExceptionNotClickable($e));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.