Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | 3187949-7.patch | 2.6 KB | jibran |
Comments
Comment #2
blazey CreditAttribution: blazey at Amazee Labs commentedComment #3
blazey CreditAttribution: blazey at Amazee Labs commentedComment #4
Kristen PolTagging for reroll.
Comment #5
ayushmishra206 CreditAttribution: ayushmishra206 at OpenSense Labs commentedTested the patch and rerolled for 9.2.x.
Comment #6
Kristen PolThanks. Needs another reroll.
Also, IMO it would be better to move the
cssSelectToXpath
method to just below thecssSelect
method inUiHelperTrait
.Comment #7
jibranFWIW, it is not a bug, IMO. It can be classified as a task. Here is the patch which address #6.
Comment #8
longwaveLooks good and makes sense. RTBC assuming tests pass.
Comment #9
catchWhat happens if someone is using
cssSelectToXpath
directly on BrowserTestBase, don't we need to deprecate it instead of moving it?Comment #10
longwaveBTB 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 reimplementcssSelectToXpath()
anyway; moving it to the trait avoids this.Comment #11
catchWhoops that makes sense...
Committed/pushed to 9.2.x, thanks!
Comment #12
jibranThanks for the swift commit.