34 ms·
We use Playwright and the Page Object Model approach to test our applications because that approach is more maintainable for larger applications. Automated E2E
by cebert 3y ago
We use Playwright and the Page Object Model approach to test our applications because that approach is more maintainable for larger applications. Automated E2E testing is something all developers are expected to do, not just an "SDET" engineer or QA engineer role. While we take the POM approach, I frequently use Playwright's recorder to help me get selectors and interactions with the DOM needed to verify a captured feature. Next, I take the code generated and incorporate it into object models. 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.
- baal80spam 3y ago> 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 https://testing-library.com/docs/queries/about#priority (main reason being: killing two birds with one stone by making sure your page is accessible).
- ddoice 3y agoImho 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.
- sebazzz 3y agoExactly, and because they are specific for the purpose of testing they are less likely to break due to changes in the HTML.