Honestly, playwright locators are all about balance. I used to go wild with chains, but now I keep ‘em short and sweet.
`getByRole` is your friend, but pair it with `name` or `exact` options for extra stability. Like `page.getByRole('button', { name: 'Submit', exact: true })`.
And if things keep breaking, maybe your app’s markup is too dynamic? Could be worth chatting with devs about adding stable IDs.
`getByRole` is your friend, but pair it with `name` or `exact` options for extra stability. Like `page.getByRole('button', { name: 'Submit', exact: true })`.
And if things keep breaking, maybe your app’s markup is too dynamic? Could be worth chatting with devs about adding stable IDs.
