h2oai / nitro

Create apps 10x quicker, without Javascript/HTML/CSS.
https://nitro.h2o.ai
Apache License 2.0
200 stars 14 forks source link

Ensure all elements have test IDs for Playwright automation. #27

Closed lo5 closed 1 year ago

coolsat commented 1 year ago

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

lo5 commented 1 year ago

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.