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
In #3167880: [meta] Convert assertions involving use of xpath to WebAssert, where possible we initially tried to scope this by module but that was rejected. Let's see if scoping by HTML element is a better approach.
Steps to reproduce
Proposed resolution
Convert calls similar to $this->xpath('//input[@type="submit"]')
to WebAssert where possible.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#6 | 3184632-6.patch | 5.82 KB | longwave |
Comments
Comment #2
longwaveComment #3
longwaveAssertButtonsTrait isn't even used in core, maybe we should just drop it as dead code.
Comment #4
paulocsPatch looks good.
If maintainers agree, we can use this approach to remove calls of xpath.
Comment #5
catchThis scoping seems fine to me. Making exactly the same change (more or less) across the whole of core is a good pattern to follow.
Patch needs a re-roll though.
Let's do that in a follow-up. I think we should grep contrib before dropping it as dead code, but even then we could deprecate it for 10.x removal if it turns out someone is using it.
Comment #6
longwaveReroll. LocaleUpdateInterfaceTest was already converted in #3184493: Remove use of concatenated t() in assertions.
Comment #9
catchCommitted/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!