Company
Date Published
Author
Dan Cuellar
Word count
1936
Language
English
Hacker News points
None

Summary

Making your app testable is crucial for determining the amount of time and resources you'll consume when writing test automation. To achieve this, consider how your app interacts with UI (and other) automation frameworks, setup scenarios, and make tests safe for concurrency. For web apps using Selenium, think ahead to identify important pieces of the DOM, using locator strategies like ID attributes or CSS selectors. In native mobile content using Appium, follow accessibility guidelines set forth by Apple and Google, such as using accessibilityIdentifier properties on UI elements. To simplify your scripts and increase reliability, consider building a test API for your application, especially when testing complex flows. When writing tests, avoid shared state and take measures to isolate tests from each other, considering bottlenecks and chokepoints that can be time-consuming to manage. By making these considerations, you'll create a highly testable application that makes writing automated tests a worthwhile experience.