Playwright Test Generator
playwright.dev
playwright.dev
IME, creating and developing an automated test framework is 1% trying to find the best locator, and 99% maintenance of tests that use dynamic, nondeterministic flows, fighting with backend issues/flakiness etc. I find Codegen to be OK-ish for only the simplest/worthless test paths.
It cries wolf a lot, but it's also saved our ass several times. So we run 3 attempts per test and if all 3 fail, sound the alarm.
1. https://github.com/microsoft/playwright/assets/13063165/7794...
Both have good heuristics for auto-waiting that simplify interactions and make them "faster" because there's not as much wasted time doing manual waits.
I particularly liked Taiko + Gauge[2], but Playwright can also be plugged into Gauge and the ergonomics are really nice because then you can write "plain English" test scripts that translate into system actions.
I have two videos that go over both:
- Playwright: https://www.youtube.com/watch?v=qYkphCJjD_k
- Taiko: https://www.youtube.com/watch?v=i-sMXPV547
[0] https://docs.gauge.org/?os=linux&language=javascript&ide=vsc...
[1] https://docs.taiko.dev/api/reference/
[2] https://docs.gauge.org/?os=linux&language=javascript&ide=vsc...
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).
This is completely true. Quality e2e tests that have good setup and cleanup and aren't flaky take focused dev work. I find myself regularly using the locator finder tool in playwright UI/debugger but I've never found any real value in using the test generator.
I could see it being valuable in a really small subset of exceedingly simple UI, probably personal-project level but even those tend to grow too complex for this.
It works for us probably because we sidestep the pain points you list - the environments we run in are pristine complete copies of known datasets, we remove as many sources of randomness as possible, and our environment flakiness level is very low.
They still break but usually because the locators in use have been chosen poorly (or we've made planned changes to a page/component)
We're a web based b2b saas that runs an instance of the entire environment for each of our customers. Our non prod setup consists of a bajillion static test environments but more importantly we use testcontainers to spin up the transient test environments from database snapshots. Using the recorder on the static environments (before the transient ones existed) _was_ a pain