Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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 |
---|---|---|---|
#7 | 2809551-7.patch | 36.81 KB | Lendude |
Comments
Comment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #7
LendudeHere is the initial split.
It turns out that ajax in preview doesn't actually work currently! It just shows the commands page when using any ajax link in preview. I can reproduce this in 8.7.x.
Quick test on a 8.5.3 site worked without issue so this might be a recent break.
real javascript testing ++
Comment #9
LendudeTurns out we already did some work in this here #2863563: Convert PreviewTest WebTestBase to BrowserTestBase and JavascriptTestBase, so lets move it there