Google has released a new open source test automation tool for iOS called EarlGrey.
EarlGrey is a native iOS UI automation test framework that enables you to write clear, concise tests. It integrates with Xcode’s Test Navigator so you can run tests directly from Xcode or the command line.
Features of EarlGrey
Synchronization
One advantage of using EarlGrey test automation framework is its synchronization features which automatically synchronizes with the UI and network requests.
Visibility Checks
EarlGrey uses screenshot differential comparison (also known as ‘screenshot diffs’) to determine the visibility of UI elements before interacting with them. As a result, you can be certain that a user can see and interact with the UI that EarlGrey interacts with.
User-like Interactions
Taps and swipes are performed using app-level touch events, instead of using element-level event handlers so you can simulate how a real user would interact with the app, thus helping you to find and fix the same bugs that users would encounter.
Another important feature which is especially important in automated testing is that EarlGrey makes sure that the elements being interacted with through the automated tests are actually visible and not just present.
How to Setup EarlGrey Test Automation Framework
- Clone the EarlGrey repository from Github:
git clone https://github.com/google/EarlGrey.git
- Once you have the repository, download all the dependencies using the
setup-earlgrey.sh
script (run the script from the cloned repo). - Once the script completes successfully, open
EarlGrey.xcodeproj
and ensure all the targets build. - You can now use
EarlGrey.xcodeproj
to make changes to the framework.
To find out more about this Open Source Test Automation Tool for iOS, visit their git repo, or you can try other open source test automation tools for mobile devices.