Problem

The next-major (Drupal 12) lane fails on every pipeline. phpstan (next major) reports two errors and phpunit (next major) exits 1, all from the same two lines: tests/src/Functional/WorkflowVariablesUiTest.php:55 and :57 call BrowserTestBase::xpath(), deprecated in Drupal 11.5.0 and removed in Drupal 13.

Both jobs are allow_failure, so the pipeline badge stays green and the failure is invisible unless the jobs are read one at a time.

No branch caused it: it appeared when core moved under the lane. The same two lines fail identically on merge requests that share nothing else, so it is reproducible on 1.x itself rather than being a property of any one branch.

Why the documented replacement is not the fix

The deprecation notice says to use BrowserTestBase::getNodeElementsByXpath(). That method arrives in Drupal 11.5. The main phpunit job installs core 11.4.5, where it does not exist, so switching to it would fatal the lane that is currently green. The project declares ^11.3 || ^12, so the fix has to hold across that whole range.

Proposed resolution

Call what xpath() itself calls, which is Mink and stable on both: $this->getSession()->getPage()->findAll('xpath', $xpath). Neither call site passes arguments, so buildXPathQuery() is not needed. Two call sites, one file.

Remaining tasks

  • Replace the two calls.
  • Confirm the two next-major jobs go green and the main lane stays green, by reading each job rather than the badge.

AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the code on the merge request. I reviewed and ran the work myself before posting it.)

Issue fork orchestra-3620932

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed e3bccd12 on 1.x
    fix: #3620932 Replace the deprecated xpath() test helper with a form...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.