"E2E tests are flaky" Yep, often true
"E2E tests are flaky"
Yep, often true.
But, E2E tests aren't inherently flaky. They're flaky for a *reason*:
π© The UI is buggy.
π© The backend is often down.
π© The DB is constantly changing.
π© The network is slow or unreliable.
E2E tests arenβt flaky. The environment is.
So find the root cause, and fix it.
And of course, sometimes the E2E test itself is poorly written.
A common mistake: The test isn't atomic.
Example:
π© E2E test deletes a record (this will only pass once)
Instead:
β E2E test creates a record, then deletes that record