Problem/Motivation
In the current WebDriverTestBase test we somehow missed \Drupal\FunctionalJavascriptTests\JSWebAssert::assertWaitOnAjaxRequest(), which is ideal for being the next command after pressing a link/button that triggers AJAX-thingies. And there are a lot of those in our FunctionalJavascriptTests
Currently we are do a lot of waitForElement black magic, which seems to be slower and the elements we're waiting for are not always correct.
Steps to reproduce
Use \Drupal\FunctionalJavascriptTests\JSWebAssert::assertWaitOnAjaxRequest() instead of waitForElement-voodoo.
Issue fork inline_entity_form-3209306
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
spokjeComment #4
spokjeLast test of Dev branch:
This MR:
Comment #5
geek-merlinFirst i thought that's genius. Then i googled that method, and it looks like the approach is doomed:
#3061852: [META] Deprecate assertWaitOnAjaxRequest() and make the JsWebAssert::waitFor*() methods behave like real assertions
Comment #6
spokjeMeh!
I'll need to look into the new proposed
waitFor*()methods to see if they're as fast as the (sadly deemed) unreliableassertWaitOnAjaxRequestmethod.Back to NW.
Comment #7
spokjeNope, this patch is doing the exact opposite of what #3061852: [META] Deprecate assertWaitOnAjaxRequest() and make the JsWebAssert::waitFor*() methods behave like real assertions and #3103081: Deprecate JsWebAssert::assertWaitOnAjaxRequest() in Drupal 9.0 and Drupal 8.9 and Replace usages of JsWebAssert::assertWaitOnAjaxRequest() in core are doing.
So this is a dead end.