Reducing UI Test Flakiness
Flaky tests often arise from timing issues in user interfaces. To mitigate this, focus on event-driven test cases rather than relying on fixed timing, and avoid hard-coding pixel locations. Instead, test for the presence of UI components, which can lead to more robust and reliable testing outcomes. Additionally, consider implementing a timeout mechanism for waiting on events to ensure tests do not hang indefinitely if an event fails to trigger.In this clip
From this podcast

Software Engineering Radio - the podcast for professional software developers
SE Radio 572: Gregory Kapfhammer on Flaky Tests
Related Questions