diff --git a/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php index d3f446cf6a..525e61b508 100644 --- a/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php +++ b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php @@ -62,11 +62,7 @@ protected function enableTheme($theme) { * Waits for off-canvas dialog to open. */ protected function waitForOffCanvasToOpen() { - $web_assert = $this->assertSession(); - // Wait just slightly longer than the off-canvas dialog CSS animation. - // @see core/misc/dialog/off-canvas.motion.css - $this->getSession()->wait(800); - $web_assert->assertWaitOnAjaxRequest(); + $this->assertSession()->waitForId('#drupal-off-canvas'); $this->assertElementVisibleAfterWait('css', '#drupal-off-canvas'); }