summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/settings_tray
diff options
context:
space:
mode:
authorcatch <6915-catch@users.noreply.drupalcode.org>2025-04-10 10:23:22 +0100
committercatch <6915-catch@users.noreply.drupalcode.org>2025-04-10 10:23:22 +0100
commit853031b63e210fe98b9f806733c0b1d3ba51957e (patch)
treeca1ac07d9ae47ade41fc360cfc6034225563e78a /core/modules/settings_tray
parent0c336f0c58ceba376fcb5209d8cce3536fec269a (diff)
downloaddrupal-853031b63e210fe98b9f806733c0b1d3ba51957e.tar.gz
drupal-853031b63e210fe98b9f806733c0b1d3ba51957e.zip
Issue #3317520 by mstrelan, nod_, wim leers: [random test failure] Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::testEditModeEnableDisable
Diffstat (limited to 'core/modules/settings_tray')
-rw-r--r--core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php5
-rw-r--r--core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php7
2 files changed, 7 insertions, 5 deletions
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
index 85eb9eadcf1..b274fa34182 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
@@ -6,6 +6,7 @@ namespace Drupal\Tests\settings_tray\FunctionalJavascript;
use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationIsClassBlock;
use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationNoneBlock;
+use Drupal\Tests\WaitTerminateTestTrait;
use Drupal\user\Entity\Role;
/**
@@ -15,6 +16,8 @@ use Drupal\user\Entity\Role;
*/
class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
+ use WaitTerminateTestTrait;
+
/**
* {@inheritdoc}
*/
@@ -44,6 +47,7 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
'search content',
]);
$this->drupalLogin($user);
+ $this->setWaitForTerminate();
}
/**
@@ -231,7 +235,6 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
* Tests enabling and disabling Edit Mode.
*/
public function testEditModeEnableDisable(): void {
- $this->markTestSkipped("Skipped due to frequent random test failures. See https://www.drupal.org/project/drupal/issues/3317520");
foreach (static::getTestThemes() as $theme) {
$this->enableTheme($theme);
$block = $this->placeBlock('system_powered_by_block');
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php
index 15b14a771e8..0de26a07a08 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php
@@ -49,11 +49,10 @@ class SettingsTrayTestBase extends OffCanvasTestBase {
// When page first loads Edit Mode is not triggered until first contextual
// link is added.
$this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode'));
- // @todo https://www.drupal.org/project/drupal/issues/3317520 Work why the
- // sleep is necessary in.
- usleep(100000);
- $block = $this->getSession()->getPage()->find('css', $block_selector);
+ $block = $this->assertSession()->waitForElementVisible('css', $block_selector);
+ $this->assertNotEmpty($block);
+
$block->mouseOver();
$block->click();
$this->waitForOffCanvasToOpen();