summaryrefslogtreecommitdiffstatshomepage
path: root/core
diff options
context:
space:
mode:
authorcatch <6915-catch@users.noreply.drupalcode.org>2025-04-29 11:31:25 +0100
committercatch <6915-catch@users.noreply.drupalcode.org>2025-04-29 11:31:25 +0100
commite56a8eb6f11789d5a5df75c5966b32f3468d2ad8 (patch)
tree34d940e79d5cfbfc64f85c587ea9f31efc31aaa0 /core
parentf9237efbff099ceda01823f7799232c09f2c5e4c (diff)
downloaddrupal-e56a8eb6f11789d5a5df75c5966b32f3468d2ad8.tar.gz
drupal-e56a8eb6f11789d5a5df75c5966b32f3468d2ad8.zip
Revert "Issue #3521621 by mstrelan: [random test failure] jQuery Events Deprecation Tests (Tests/dialogDeprecations)"
This reverts commit f9237efbff099ceda01823f7799232c09f2c5e4c.
Diffstat (limited to 'core')
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogDeprecationsTest.php51
-rw-r--r--core/tests/Drupal/Nightwatch/Tests/dialogDeprecations.js36
2 files changed, 36 insertions, 51 deletions
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogDeprecationsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogDeprecationsTest.php
deleted file mode 100644
index e91870a13d5..00000000000
--- a/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogDeprecationsTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Drupal\FunctionalJavascriptTests\Dialog;
-
-use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
-use PHPUnit\Framework\Attributes\IgnoreDeprecations;
-
-/**
- * Tests jQuery events deprecations.
- *
- * @group dialog
- */
-class DialogDeprecationsTest extends WebDriverTestBase {
-
- /**
- * {@inheritdoc}
- */
- protected $defaultTheme = 'stark';
-
- /**
- * {@inheritdoc}
- */
- protected static $modules = [
- 'block',
- 'js_deprecation_test',
- ];
-
- /**
- * Tests that the deprecation events are triggered.
- */
- #[IgnoreDeprecations]
- public function testDialogDeprecations(): void {
- $this->drupalLogin($this->drupalCreateUser(['administer blocks']));
- $this->drupalGet('/admin/structure/block');
- $assert_session = $this->assertSession();
-
- $button = $assert_session->waitForElement('css', '[data-drupal-selector="edit-blocks-region-sidebar-first-title"]');
- $this->assertNotNull($button);
- $button->click();
-
- $this->getSession()->executeScript(<<<JS
- setTimeout(() => {
- window.jQuery('.ui-dialog-content').trigger('dialogButtonsChange');
- }, 100);
-JS);
- $this->expectDeprecation('Javascript Deprecation: jQuery event dialogButtonsChange is deprecated in 11.2.0 and is removed from Drupal:12.0.0. See https://www.drupal.org/node/3464202');
- }
-
-}
diff --git a/core/tests/Drupal/Nightwatch/Tests/dialogDeprecations.js b/core/tests/Drupal/Nightwatch/Tests/dialogDeprecations.js
new file mode 100644
index 00000000000..154a2932834
--- /dev/null
+++ b/core/tests/Drupal/Nightwatch/Tests/dialogDeprecations.js
@@ -0,0 +1,36 @@
+const dialogDeprecationsTest = {
+ '@tags': ['core', 'dialog'],
+
+ before(browser) {
+ browser
+ .drupalInstall()
+ .drupalInstallModule('block')
+ .drupalInstallModule('js_deprecation_test')
+ .drupalInstallModule('js_testing_log_test');
+ },
+ after(browser) {
+ browser.drupalUninstall();
+ },
+
+ 'jQuery Events Deprecation Tests': (browser) => {
+ browser.drupalLoginAsAdmin(() => {
+ browser
+ .drupalRelativeURL('/admin/structure/block')
+ .waitForElementVisible('body', 1000)
+ .execute(function () {
+ const button = document.querySelector(
+ '[data-drupal-selector="edit-blocks-region-sidebar-first-title"]',
+ );
+ button.click();
+ setTimeout(() => {
+ window.jQuery('.ui-dialog-content').trigger('dialogButtonsChange');
+ }, 100);
+ })
+ .assert.deprecationErrorExists(
+ 'jQuery event dialogButtonsChange is deprecated in 11.2.0 and is removed from Drupal:12.0.0. See https://www.drupal.org/node/3464202',
+ );
+ });
+ },
+};
+
+module.exports = dialogDeprecationsTest;