You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! We are looking to release v1 of this library in the near future and are not looking to add any additional features at this point.
I would recommend either using a unique test identifier (eg data-testid) if you need to find a component and a regular querySelector syntax is not specific enough.
v2 of this lib, which will target Vue 3, will have a kind of plug-in feature where you can add this feature yourself. See here for the current implementation (which is a WIP).
What problem does this feature solve?
Create a xfind method which allows for xpath selectors as an alternative to css selectors of find method.
What does the proposed API look like?
Currently:
wrapper.find('a#abc[for="xyz"]')
Proposed:
wrapper.xfind('//a[@id="abc"][@for="xyz"]')
Currently:
wrapper.find('ul > li')
Proposed:
wrapper.xfind('//ul/li')
Currently:
wrapper.find('h1:not([id])')
Proposed:
wrapper.xfind('//h1[not(@id)]')
Other examples:
Arithmetic
xfind('//product[@price > 2.50]')
Or logic
xfind('//a[@name or @href]')
XPath examples taken from here
The text was updated successfully, but these errors were encountered: