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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
FileSize
6.74 KB
longwave’s picture

AssertButtonsTrait isn't even used in core, maybe we should just drop it as dead code.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good.
If maintainers agree, we can use this approach to remove calls of xpath.

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

This 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.

AssertButtonsTrait isn't even used in core, maybe we should just drop it as dead code.

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.

longwave’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
FileSize
5.82 KB

Reroll. LocaleUpdateInterfaceTest was already converted in #3184493: Remove use of concatenated t() in assertions.

  • catch committed e0c8ce1 on 9.2.x
    Issue #3184632 by longwave: Convert assertions involving use of xpath on...

  • catch committed cce00b6 on 9.1.x
    Issue #3184632 by longwave: Convert assertions involving use of xpath on...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

Status: Fixed » Closed (fixed)

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