Problem/Motivation
This is a child issue of #3061852: [META] Deprecate assertWaitOnAjaxRequest() and make the JsWebAssert::waitFor*() methods behave like real assertions, which plans to deprecate JsWebAssert::assertWaitOnAjaxRequest().
This issue is to remove all usages of JsWebAssert::assertWaitOnAjaxRequest() in core and replace with either one of the JsWebAssert::waitFor*() methods or something akin to them.
Given that there are 240 occurrences of assertWaitOnAjaxRequest() in core, we may want to break this up into some subtasks, if it proves difficult to review and move this issue forward.

For some of these, we could break it up by module. Layout builder currently has 81 usages, for example.
Proposed resolution
- Remove all usages of
JsWebAssert::assertWaitOnAjaxRequest() - Replace with other ways of waiting,
JsWebAssert::waitFor*()methods or something akin to them
Remaining tasks
Do it.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3103081-14.patch | 143.58 KB | oknate |
| #14 | 3103081--interdiff-13-14.txt | 1.48 KB | oknate |
| #13 | 3103081-13.patch | 143.24 KB | oknate |
| #13 | 3103081--interdiff-12-13.txt | 41.66 KB | oknate |
| #12 | 3103081-12.patch | 103.17 KB | oknate |
Comments
Comment #2
oknateComment #3
oknateComment #4
oknateHere's a patch to deprecate
JsWebAssert::assertWaitOnAjaxRequest().Comment #5
oknateComment #6
oknateComment #7
oknateHere's some initial work on replacing the usage of JsWebAssert::assertWaitOnAjaxRequest(). This takes the number of usages down to about 110.
I opened some side issues:
One note for the next patch:
This should be wrapped in
$this->assertNotEmpty(). Any call to$assert_session->waitForElementshould be, until #3103101: Make the JsWebAssert::waitFor*() methods behave like real assertions lands.Comment #8
shubhangi1995Comment #9
oknate@shubhangi1995, Sorry, I should have assigned this to myself. I'm assigning back to myself. I spent many hours on this yesterday and I'm not done. Sorry to do that.
Comment #10
oknateComment #11
oknateMostly fixing this:
ArgumentCountError: Too few arguments to function Drupal\FunctionalJavascriptTests\JSWebAssert::waitForFormBuildIdChange()I was working on adding the argument and got distracted and committed it incomplete. Removing for now.
I'd like to make waitForFormBuildIdChange a little more generic so it can work when there is more than one form_build_id on a page.
Comment #12
oknateAdd more conversions.
Comment #13
oknateAdding more conversions. Some of the layout builder changes are out of scope, and we'll probably need to roll those off into a separate issue.
Comment #14
oknatePrevious test timed out due to test code.