Closed (fixed)
Project:
Webform
Version:
6.3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2026 at 08:49 UTC
Updated:
16 Mar 2026 at 17:00 UTC
Jump to comment: Most recent
WebformElementComputedJavaScriptTest::testComputedElementAjax intermittently fails with a StaleElementReference exception or incorrect hidden field values.
Three issues:
fillField for the a[select] element. On select elements, fillField does not reliably fire a change event in WebDriver. selectFieldOption should be used instead.selectFieldOption fires a change event which triggers the computed element's 500ms debounce AJAX. fillField on a number input does not fire change (only sets the value). So the number field must be filled before the select, ensuring both values are present when the select's change event triggers the AJAX computation.waitForText is ambiguous: The test form has multiple computed elements (webform_computed_twig and webform_computed_twig_token) that both produce the same visible text "1 + 1 = 2". waitForText scans the entire page and can match the other element's output before the one being asserted has updated, causing the subsequent hiddenFieldValueEquals check to fail.selectFieldOption instead of fillField for the select elementb) before selecting the option (a[select]) so both values are set when AJAX firesexecuteScript jQuery call and waitForText with $session->wait() polling for the specific hidden field value by name, which reliably handles the debounce timing and avoids ambiguity with other computed elements on the pageStart 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
mably commentedComment #4
mably commentedComment #10
liam morlandThanks!