nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Ensure all elements have test IDs for Playwright automation.

Open lo5 opened this issue 2 years ago • 1 comments

lo5 avatar Jul 04 '22 04:07 lo5

Hi @lo5 , this will really help in creating a robust automated suite. Any chance this can go higher up in priority? thanks!

coolsat avatar Sep 26 '22 23:09 coolsat

This will be released in 0.17.

Note that:

  1. box(name='foo', ...) is translated to <element data-name='foo' .../>, always.
  2. 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.

lo5 avatar Oct 17 '22 23:10 lo5