Closed JayBizzle closed 1 year ago
This has broken dusk selectors with spaces.
This has broken dusk selectors with spaces.
Thanks for reporting, will submit a fix when I get the the office in a couple of hours 👍🏻
@JayBizzle No troubles. In my opinion the functionality that you have added here is worth the breaking change. I'd be interested to see how wide spread the space issue is. Swapping my spaces out won't be too much work, it's mainly for selecting submenus in react components. A breaking change nonetheless. Thanks for the quick response.
Just working on this now. Allowing spaces isn't an issue.
Characters we can't allow (that I can see using regex) are CSS chaining chars like .
, >
, &
etc otherwise things like this won't work...
@dusk selector .class
@dusk selector > div
PR will be ready in about 10 mins
I think that would go against the descendant CSS selector spec. ie if you are trying to target descendants of a selector
<div dusk="all-items">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</div>
You could rightfully use @all-items div
, using spaces would break this @all items div
.
Yes, that is the problem I have hit with the solution. There doesn't seem to be a way around that unfortunately.
See #1035 to continue discussion 👍
@patrickomeara seems Taylor has decided to continue with this PR, sorry.
I have come across a few situations when writing Dusk tests where I use the
dusk
attribute selector on a wrapperdiv
, then want to select elements within thatdiv
...e.g.
And I was hoping I could do something like this...
...but this doesn't work because the selector gets compiled to
[dusk="all-items > div"]
This PR makes this selector get compiled to
[dusk="all-items"] > div
Bonus
Also allows multiple
dusk
attribute selectors to work as expectedThis selector...
becomes...