End-to-end tests are basically non-deterministic state machines. Flakiness can come from any point in the test: bad tests, bad state management, conflicting tests, network hiccups, etc.
Your goal is to reduce every single point of that flakiness. Just make sure you keep track of it. Sometimes flakiness in tests is really pointing at flakiness in the product itself.
Some things that can help reduce that flakiness:
- Dedicated network
- No external dependencies
- Polling instead of static waits/sleeps
And what is the token in the link?