phoenix_test icon indicating copy to clipboard operation
phoenix_test copied to clipboard

Find by aria-label

Open jaimeiniesta opened this issue 5 months ago • 1 comments

It would be great to be able to find elements by its aria-label property, for example, this input should be findable by its aria-label "Your Name"

<input id="name" type="text" name="name" aria-label="Your Name"/>

I think that's not possible currently. Are there plans to support ARIA attributes?

jaimeiniesta avatar Jul 31 '25 14:07 jaimeiniesta

Hey @jaimeiniesta! Yes, I'd love to support that at some point. I made some initial strides in places like when we click a buttonhttps://github.com/germsvel/phoenix_test/blob/fe5e986bc3f51dd18688383fbe1d5535cd5b3774/lib/phoenix_test/live.ex#L65), it'll try to find a button by different roles.

I had hoped to do something similar with labels, where it can be the label or aria label and stuff like that.

I'm not sure if that makes sense, but if you're interested in contributing to that, I'd be happy to review a PR!

germsvel avatar Aug 04 '25 08:08 germsvel