When I inherit a flaky, slow UI suite I start by measuring a baseline in week one: flakiness rate, average test runtime, and CI pass rate (for example, 30% flakiness, 8h suite runtime, 70% CI pass). My immediate moves are triage and containment — tag and quarantine tests that cause >50% of failures, add minimal retries where failures are environmental, and run the suite in parallel to get faster feedback. Over weeks 2–6 I rewrite brittle UI asserts, increase API-level tests (moving ~40–60% of checks off the UI), and introduce stable locators and test data fixtures. I track flakiness %, mean time to green, and total runtime; my target is <5% flakiness and cutting runtime to under 2 hours in 4–8 weeks. Trade-offs: I accept temporarily reduced UI coverage and freeze new UI tests to focus on stability.
Get AI-powered feedback on your answer and improve your skills
Takes 5-10 minutes