Problem/Motivation

UiHelperTrait uses cssSelectToXpath which is part of BrowserTestBase. This causes an error in wietzman's ExistingSiteBase (part of DrupalTestTraits) that uses UiHelperTrait but doesn't extend BrowserTestBase.

Steps to reproduce

Use UiHelperTrait in a class that doesn't extend BrowserTestBase.

Proposed resolution

Move cssSelectToXpath to UiHelperTrait.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Moved cssSelectToXpath from BrowserTestBase to UiHelperTrait.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blazey created an issue. See original summary.

blazey’s picture

Status: Active » Needs review
FileSize
2.3 KB
blazey’s picture

Issue summary: View changes
Kristen Pol’s picture

Assigned: blazey » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs reroll

Tagging for reroll.

ayushmishra206’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
33.07 KB
2.56 KB

Tested the patch and rerolled for 9.2.x.

Kristen Pol’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Bug Smash Initiative

Thanks. Needs another reroll.

Also, IMO it would be better to move the cssSelectToXpath method to just below the cssSelect method in UiHelperTrait.

jibran’s picture

Status: Needs work » Needs review
FileSize
2.6 KB

FWIW, it is not a bug, IMO. It can be classified as a task. Here is the patch which address #6.

longwave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

Looks good and makes sense. RTBC assuming tests pass.

catch’s picture

Status: Reviewed & tested by the community » Needs review

What happens if someone is using cssSelectToXpath directly on BrowserTestBase, don't we need to deprecate it instead of moving it?

longwave’s picture

Status: Needs review » Reviewed & tested by the community

BTB includes UiHelperTrait, so for users of BTB this is unchanged, but moving it into the trait means other base classes can take advantage of it.

As an example UiHelperTrait::click() calls $this->cssSelectToXpath(), so for ::click() to be useful the parent class currently has to reimplement cssSelectToXpath() anyway; moving it to the trait avoids this.

catch’s picture

Category: Bug report » Task
Status: Reviewed & tested by the community » Fixed

Whoops that makes sense...

Committed/pushed to 9.2.x, thanks!

jibran’s picture

Issue tags: +DTT issue

Thanks for the swift commit.

  • catch committed 05ce3e8 on 9.2.x
    Issue #3187949 by ayushmishra206, blazey, jibran, longwave, Kristen Pol...

Status: Fixed » Closed (fixed)

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