Make ::assertWaitOnAjaxRequest emit a deprecation error if js_testing_ajax_request_test module isn't enabled

Created on 21 December 2023, 11 months ago
Updated 4 March 2024, 9 months ago

Problem/Motivation

📌 Stabilize FunctionalJavascript testing AJAX: add ::assertExpectedAjaxRequest() Fixed changed how ::assertWaitOnAjaxRequest worked via the use of js_testing_ajax_request_test
This module is always enabled in tests extending from WebDriverTestBase

However in contrib solutions like drupal-testing-traits, it may not

Steps to reproduce

Create a test based on DTT, and use webdriver.
Use ::assertWaitOnAjaxRequest and notice your tests fail

Proposed resolution

Emit a deprecation error (or perhaps even fail the test with a meaningful message) if the module is not installed and that method is used.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 4 hours ago

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @larowlan
  • 🇺🇸United States sker101 NYC

    We just ran into an issue that seems to be related to this one after upgrading to the latest Drupal release (10.2.3).

    All our "ExistingSiteSelenium2DriverTestBase" tests are throwing the error "Unable to complete Ajax request" when calling the "assertWaitOnAjaxRequest" method.

    The solution we've found so far is to set the setting `extension_discovery_scan_tests` to `true` and enable the `js_testing_ajax_request_test` module manually in the test via the "module_installer" service.

    Please let us know if there is any better approach to enable the testing module.

Production build 0.71.5 2024