function OffCanvasTestTrait::waitForOffCanvasArea
Same name in other branches
- 10 core/modules/system/tests/src/Traits/OffCanvasTestTrait.php \Drupal\Tests\system\Traits\OffCanvasTestTrait::waitForOffCanvasArea()
- 11.x core/modules/system/tests/src/Traits/OffCanvasTestTrait.php \Drupal\Tests\system\Traits\OffCanvasTestTrait::waitForOffCanvasArea()
Waits for the off-canvas area to appear, resized and visible.
6 calls to OffCanvasTestTrait::waitForOffCanvasArea()
- AjaxBlockTest::testAddAjaxBlock in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ AjaxBlockTest.php - Tests configuring a field block for a user field.
- ContentPreviewToggleTest::assertContextualLinks in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ ContentPreviewToggleTest.php - Checks if contextual links are working properly.
- LayoutBuilderDisableInteractionsTest::assertContextualLinksClickable in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderDisableInteractionsTest.php - Confirms that Layout Builder contextual links remain active.
- LayoutBuilderTest::assertOffCanvasFormAfterWait in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderTest.php - Waits for the specified form and returns it when available and visible.
- LayoutBuilderTest::testConfigurableLayoutSections in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderTest.php - Tests configurable layouts.
File
-
core/
modules/ system/ tests/ src/ Traits/ OffCanvasTestTrait.php, line 17
Class
- OffCanvasTestTrait
- Provides helper methods for interacting with the off-canvas area.
Namespace
Drupal\Tests\system\TraitsCode
protected function waitForOffCanvasArea() : void {
// The data-resize-done attribute is added by the off_canvas_test module's
// wrapper around Drupal.offCanvas.resetSize.
$this->assertNotEmpty($this->assertSession()
->waitForElementVisible('css', '[data-resize-done="true"]'));
// Remove the data-resize-done attribute so in scenarios where off-canvas
// opens yet another off-canvas, waitForOffCanvasArea() is looking for the
// attribute on a new dialog, not an existing one.
$this->getSession()
->executeScript('document.querySelector("[data-resize-done]").removeAttribute("data-resize-done")');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.