I worked with cypress for few months and I get used to work with data-auto-id which is basically unique selector in my understanding.
<button data-auto-id="my-nice-button">
and then i can select it in cypress
cy.get([data-auto-id='my-nice-button']...
Now i tried playwright but selecting by text or stuff like this seems pretty unsafe for me. Example from their website:
await page.locator('article:has-text("Playwright")').click();
What is considered safe approach? Should I use IDs in playwright or can I jump into CSS, text and other selectors? Please note that I have no real world experience so I don't know what's considered best practice. This question is not opinion based its more like is it safe or no?