-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow dusk
attribute selectors to be chained
#1034
Conversation
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
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 |
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...