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

(cherry picked from commit 2b3f1b960e)
merge-requests/2674/head
xjm 2022-08-24 15:16:02 -05:00
parent 5368b3d3cf
commit ef4c3e6e60
No known key found for this signature in database
GPG Key ID: 206B0B8743BDF4C2
2 changed files with 7 additions and 8 deletions

View File

@ -21,6 +21,7 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
'node',
'search',
'settings_tray_test',
'off_canvas_test',
];
/**
@ -241,7 +242,6 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
case 'contextual_link':
$this->clickContextualLink($this->getBlockSelector($block), "Quick edit");
$this->waitForOffCanvasToOpen();
$this->markTestSkipped("Skipped temporarily for random fails.");
$this->assertEditModeEnabled();
break;

View File

@ -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 @@ abstract class OffCanvasTestBase extends WebDriverTestBase {
* @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);
}
/**