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 |
|---|---|---|---|
| #9 | 2809507-9.patch | 4.35 KB | ApacheEx |
| #8 | interdiff-2809507-5-8.txt | 1.45 KB | ApacheEx |
| #8 | 2809507-8.patch | 4.79 KB | ApacheEx |
Comments
Comment #3
michielnugter commentedComment #5
ApacheEx commentedHere is a patch. Only
testAjaxEnabledEffectFormhas ajax part.Comment #7
dawehnerThank you for starting this patch!
Note: We try to avoid
assertWaitOnAjaxRefreshand rather use one of the other methods on\Drupal\FunctionalJavascriptTests\JSWebAssertComment #8
ApacheEx commentedthanks for your feedback. Here is updated patch.
I've also found out why it randomly fails (even on my local).
A style label which generates like this:
can contain HTML special characters like
&, ", ', <, >.For example,
"uMg>&pjwill be converted to"uMg>&pjby Html::escape, but browser will convert this html to"uMg>&pj.Markup::create(Xss::filter($style_label))seems to fix it.Comment #9
ApacheEx commentedhm, if this patch is passed then whole
ImageAdminStylesTestcan be converted toBrowserTestBase.Let's wait for the result and decide next steps.
Comment #11
Anonymous (not verified) commentedAdded related issue with JTB version.
Comment #12
mondrakeThis was done in #2959466: Convert web tests to browser tests for image module (Part 2).