You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an input field is properly connected to a label it would be nice to be able to fill the input field based on the label text using await page.fill('text=Name', 'John Doe');.
It's often possible to fill the input field based on a CSS selector like id or name, but making it possible to fill by label text would make it more straight-forward to both read and write the test. Especially if you write tests for screens you did not make yourself.
i think in general label= could be a nice selector strategy.
I would feel comfortable to mix it with general Text selector, because then it would be possible anymore to select the tag itself with the "Text" selector.
i would also not limit it to fields!
Labels can be used on:
When an input field is properly connected to a label it would be nice to be able to fill the input field based on the label text using
await page.fill('text=Name', 'John Doe');
.It's often possible to fill the input field based on a CSS selector like
id
orname
, but making it possible to fill by label text would make it more straight-forward to both read and write the test. Especially if you write tests for screens you did not make yourself.Examples of cases where it should work:
The text was updated successfully, but these errors were encountered: