nitro
nitro copied to clipboard
Ensure all elements have test IDs for Playwright automation.
Hi @lo5 , this will really help in creating a robust automated suite. Any chance this can go higher up in priority? thanks!
This will be released in 0.17.
Note that:
-
box(name='foo', ...)
is translated to<element data-name='foo' .../>
, always. -
option(name='foo')
is translated to<element data-name='foo' .../>
, but only where possible.
In general, data-name='foo'
is set on the container, not the element itself, so if you're using query selectors in the test automation framework, use [data-name='foo'] input
to refer to input elements and [data-name='foo'] button
to refer to buttons, instead of input[data-name='foo']
or button[data-name='foo']
, i.e. look for a child, not self.