EarlGrey - iOS Functional UI Testing Framework
Tuesday, February 16, 2016
By Siddartha Janga on behalf of Google iOS Developers
Brewing for quite some time, we are excited to announce EarlGrey, a functional UI testing framework for iOS. Several Google apps like YouTube, Google Calendar, Google Photos, Google Translate, Google Play Music and many more have successfully adopted the framework for their functional testing needs.
The key features offered by EarlGrey include:
Are you in need for a cup of refreshing EarlGrey? EarlGrey has been open sourced under the Apache license. Check out the getting started guide and add EarlGrey to your project using CocoaPods or manually add it to your Xcode project file.
Brewing for quite some time, we are excited to announce EarlGrey, a functional UI testing framework for iOS. Several Google apps like YouTube, Google Calendar, Google Photos, Google Translate, Google Play Music and many more have successfully adopted the framework for their functional testing needs.
The key features offered by EarlGrey include:
- Powerful built-in synchronization : Tests will automatically wait for events such as animations, network requests, etc. before interacting with the UI. This will result in tests that are easier to write (no sleeps or waits) and simple to maintain (straight up procedural description of test steps).
- Visibility checking : All interactions occur on elements that users can see. For example, attempting to tap a button that is behind an image will lead to test failure immediately.
- Flexible design : The components that determine element selection, interaction, assertion and synchronization have been designed to be extensible.
Are you in need for a cup of refreshing EarlGrey? EarlGrey has been open sourced under the Apache license. Check out the getting started guide and add EarlGrey to your project using CocoaPods or manually add it to your Xcode project file.
This is exciting! Is it built on Xcode's existing UI Testing framework or XCTest?
ReplyDeleteHey Joe,
DeleteEarlGrey right now is based on XCTest. However, the next version being worked on right now should integrate EarlGrey with XCUITest. Do feel free to contribute.
Hi Joe,
ReplyDeletethis is built on XCTest. Read more here : https://github.com/google/EarlGrey/blob/master/README.md
Thanks!
Will Earl Grey be able to handle mobile Web Automation?
ReplyDeleteHello,
DeleteI was unable to test WkWebview based Hybrid iOS application using EarlGrey.
Can't seem to find a way to test the UI elements in a html which is loaded in my WkWebview.
Is there a solution?
why should I chose EarlGrey instead of xcode UI test framework? What are the difference between them?
ReplyDeletegood question. no one reply?
DeleteWhile this is a longer discussion, in a nutshell, this is the main advantage to using EarlGrey:
DeleteEarlGrey is a grey-box framework rather and a black box framework like XCUITest. You have access to the app's state and the app's variables which makes EarlGrey more versatile. You can create custom matchers, actions and assertions that can utilize all these features to provide a wider coverage.
Please feel free to message us on our Google Group to have a more in-depth discussion.
Hi Everyone,
ReplyDeleteI recently tried Earl grey as discussed above.
1.So,I installed Pod Earl Grey in my project.There after I can successfully add the line import EarlGrey in to my UI Tests.But as similar to code above I am not able to write the code.
EarlGrey.selectElement(with: matcher)
.perform(action)
but, I am seeing EarlGreyImpl instead of EarlGrey.selectElement
2.what is the difference between EarlGrey and EarlgreyTests.
As is see the versions of it EarlGrey (1.16.0) and EarlGreyTest (2.2.1)
Will these versions make any difference.
3.In the above code I see there are GTX checks that are enabled is it required or just need to write the EarlGrey tests in test stubs.
As I used, app is crashing.