This document discusses Earl Grey, an open source UI testing framework for iOS apps created by Google. It describes how Earl Grey enables writing clear and concise UI tests by providing synchronization, user interactions like taps and swipes, and extensible APIs. The document outlines Earl Grey's selection, action and assertion APIs and provides examples of selecting elements and performing taps. It also mentions some of Earl Grey's other features like custom matchers and failure handlers.
17. EARL GREY IS AN UI AUTOMATION
TEST FRAMEWORK THAT ENABLES
YOU TO WRITE CLEAR, CONCISE
TESTS.
18. EARL GREY
▸ Google’s internal UI Testing framework.
▸ Used in YouTube, Google Calendar, Google Photos,
Google Translate, Google Play Music.
▸ Recently open sourced.
19. FEATURES
▸ Synchronization.
▸ User-like interactions (taps, swipes).
▸ Visibility checks before interactions.
▸ Extensible API - custom UI actions and assertions.
20. HOW EARL GREY WORKS
▸ EarlGrey runs in the same process as the app under test,
and has access to the same memory as the app.
▸ Uses private methods to learn view hierarchy and inject
touches.
▸ Works in conjunction with the XCTest framework.
21. EARL GREY API
▸ Interaction APIs
▸ Synchronization APIs
▸ Other Top Level APIs
22. INTERACTION APIS
▸ Selection API - Selecting an element to interact with.
▸ Action API - Performing an action on it,
▸ Assertion API - Making an assertion to verify state and
behavior.
24. SELECTION
▸ A GREYMatcher compliant object can be ambiguous and match
multiple elements.
▸ Must be narrowed down until a single element is identified.
▸ You can combine multiple GREYMatchers using -
grey_allOf()
grey_anyOf()
grey_not()
▸ Example:
let sendButtonMatcher : <GREYMatcher> =
grey_allOf(grey_accessibilityLabel("Send"), grey_sufficientlyVisible(), nil)
EarlGrey().selectElementWithMatcher(sendButtonMatcher)