Description
With playwright version 1.27.0 the code that is created through recording has changed completely.
See below the same flow recorded with a recent version and with 1.26.0:
Previously we consistently got "page.locator" entries, now we get a mixture of "page.getBy"... and "page.locator" entries. Additionally we get some entries that are very difficult to read:
So in the current version the recording is not usable to us, as it would create inconsistent selectors. What we are prefering in our project are selectors identify by text and chain back/forward to other text like this:
As every project has different preferences I suggest of introduce a configuration possibilities on created code where you could specfiy things like: "always use the attribute id unless there is a text on the element".
Some ideas for configuration possibilities:
- Use attribute "xy"
- Prefer CSS selectors
- Prefer Labels selectors
- Prefer ARIA roles