Four hundred brittle selectors, no test IDs, and a redesign next quarter. This is one of the most common situations a senior engineer inherits, and the fix is only half technical.
The technical half: a locator hierarchy, written down.
Playwright's own guidance is user-facing locators first, and at scale that needs to become a policy rather than a preference:
1. Role and accessible name. getByRole('button', { name: 'Save contact' }). Best default. Stable, readable, and it fails when a screen reader user would also struggle, which means your suite checks accessibility for free.