Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
drupalPostAjaxForm()
is simulating the behaviour of ajax.js
, so using it, doesn't really provide fundamental guarantees.
#2809161: Convert Javascript/AJAX testing to use JavascriptTestBase suggests to convert them to JavascriptTestBase
Proposed resolution
- Figure out which part of the test is testing PHP code and which part ajax behaviour
- Extract the ajax behaviour into a test that extends JavascriptTestBase
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#20 | 2809543-20.patch | 1.42 KB | Lendude |
#16 | 2809543-16.patch | 1.4 KB | Lendude |
#11 | 2809543-11.patch | 6.38 KB | Lendude |
#11 | interdiff-2809543-7-11.txt | 1.44 KB | Lendude |
#7 | 2809543-7.patch | 7 KB | Tess Bakker |
Comments
Comment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #6
Tess BakkerComment #7
Tess BakkerPatch with:
- conversion of the AJAX part to Webdriver test
- other tests to Browser test (with some speed improvement, by using the testing profile)
Comment #8
Tess BakkerComment #9
LendudeThis looks great, just some minor clean up as far as I can see:
So nice that the browser test doesn't need this anymore!
Still weird that this is needed, but I saw it fail otherwise....so lets keep it
This can just be {@inheritdoc} in the new test.
Do we need the block in the javascript test? Don't think so, right? And the page caching?
Comment #11
LendudeAddressed my own feedback
#9.2 works on my machine when I take it out, lets see what the Bot thinks
Comment #12
borisson_The Bot, it agrees! As do I, this looks very solid and #11 resolves #9.
Comment #13
alexpottCommitted and pushed e4146aa44f to 8.7.x and 7a3a01f34f to 8.6.x. Thanks!
Comment #16
LendudeWhoops, this actually forgot to move the new tests to the right spot and failed to set the right namespace!
Comment #17
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #19
alexpottUnfortunately the patch does not apply.
Comment #20
LendudeRerolled for 8.7.x
Comment #21
borisson_The patch applies again.
Comment #22
alexpottCommitted and pushed 57dfd4ba8c to 8.7.x and a42db5a7ee to 8.6.x. Thanks!