protected function LayoutBuilderDisableInteractionsTest::assertElementUnclickable in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest::assertElementUnclickable()
Checks if element is unclickable.
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 177
Class
- LayoutBuilderDisableInteractionsTest
- Tests the Layout Builder disables interactions of rendered blocks.
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
protected function assertElementUnclickable(NodeElement $element) {
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
->assertStringContainsString('is not clickable at point', $e
->getMessage());
}
}