Re:Playwright Test Generator
by baal80spam on Thursday March 14, 2024 @03:10PM
(#39707786)
> Adding an automation attribute to all of your elements that are both unique and stable helps go a long way to make E2E tests enjoyable.
First of all maybe it wasn't clear from my comment but I use (and like it a lot) Playwright on a daily basis.
Second - did you mean using a testid for example? Because we specifically avoid using special attributes for this purpose and instead follow best practices as detailed here: https://testing-library.com/docs/queries/about#priority (main reason being: killing two birds with one stone by making sure your page is accessible).
Re:Playwright Test Generator
by ddoice on Thursday March 14, 2024 @05:07PM
(#39708989)
Imho IDs are more explicit, and a bless when working with large codebase apps, when trying to finding the related code to an element just grab the id and search for it.
First of all maybe it wasn't clear from my comment but I use (and like it a lot) Playwright on a daily basis.
Second - did you mean using a testid for example? Because we specifically avoid using special attributes for this purpose and instead follow best practices as detailed here: https://testing-library.com/docs/queries/about#priority (main reason being: killing two birds with one stone by making sure your page is accessible).