Verified Commit 30ac3b44 authored by Jess's avatar Jess
Browse files

Issue #3304901 by bnjmnm, nod_: Fix intermittently failing Settings Tray...

Issue #3304901 by bnjmnm, nod_: Fix intermittently failing Settings Tray Functional Javascript tests

(cherry picked from commit 2b3f1b96)
parent 4dcc6bb9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
    'node',
    'search',
    'settings_tray_test',
    'off_canvas_test',
  ];

  /**
@@ -241,7 +242,6 @@ public function testEditModeEnableDisable() {
          case 'contextual_link':
            $this->clickContextualLink($this->getBlockSelector($block), "Quick edit");
            $this->waitForOffCanvasToOpen();
            $this->markTestSkipped("Skipped temporarily for random fails.");
            $this->assertEditModeEnabled();
            break;

+6 −7
Original line number Diff line number Diff line
@@ -3,18 +3,22 @@
namespace Drupal\Tests\system\FunctionalJavascript;

use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Tests\system\Traits\OffCanvasTestTrait;

/**
 * Base class contains common test functionality for the Off-canvas dialog.
 */
abstract class OffCanvasTestBase extends WebDriverTestBase {

  use OffCanvasTestTrait;

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    // @todo Remove this in https://www.drupal.org/node/3219959
    'block',
    'off_canvas_test',
  ];

  /**
@@ -75,14 +79,9 @@ protected function enableTheme($theme) {
   * @throws \Behat\Mink\Exception\ElementNotFoundException
   */
  protected function waitForOffCanvasToOpen($position = 'side') {
    $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->assertElementVisibleAfterWait('css', '#drupal-off-canvas');
    $this->waitForOffCanvasArea();
    // Check that the canvas is positioned on the side.
    $web_assert->elementExists('css', '.ui-dialog-position-' . $position);
    $this->assertSession()->elementExists('css', '.ui-dialog-position-' . $position);
  }

  /**