+0
日增长
5,701
stars
736
forks
222
watchers
1,773
prs
460
issues
37
releases
README
Deprecation: EarlGrey 1.0 is deprecated in favor of EarlGrey 2.0 which integrates it with XCUITest. Please look at the earlgrey2 branch. EarlGrey 1.0 is not being maintained internally with iOS 13.
EarlGrey
For EarlGrey 2, please go to earlgrey2 branch.
EarlGrey is a native iOS UI automation test framework that enables you to write
clear, concise tests.
With the EarlGrey framework, you have access to enhanced synchronization
features. EarlGrey automatically synchronizes with the UI, network requests,
and various queues; but still allows you to manually implement customized
timings, if needed.
EarlGrey’s synchronization features help to ensure that the UI is in a steady
state before actions are performed. This greatly increases test stability and
makes tests highly repeatable.
EarlGrey works in conjunction with the XCTest framework and integrates with
Xcode’s Test Navigator so you can run tests directly from Xcode or the command
line (using xcodebuild).
Getting Started
The EarlGrey documentation for users is located in the
EarlGrey/docs folder.
To get started, review the EarlGrey features, check for backward compatibility,
and then install/run EarlGrey with your test target. After everything is
configured, take a look at the EarlGrey API and start writing your own tests.
Features
Backward Compatibility
Install and Run
API
Cheat Sheet
Getting Help
If you need help, several resources are available. First check the FAQ.
If you have more questions after reading the FAQ, see Known Issues.
You can bring more specific issues to our attention by asking them on
stackoverflow.com using the earlgrey tag.
You can also start new discussions with us on our Google group
or request to join our slack channel.
FAQ - Frequently Asked Questions
IFAQ - Infrequently Asked Questions
Known Issues
Stack Overflow
Slack
Google Group
Analytics
To prioritize and improve EarlGrey, the framework collects usage data and
uploads it to Google Analytics. More specifically, the framework collects the
MD5 hash of Bundle ID, Test Class Names and Test Method Names. This
information allows us to measure the volume of usage. For more detailed
information about our analytics collection, please peruse the
GREYAnalytics.m
file which contains the implementation details. If they wish, users can choose
to opt out by disabling the Analytics config setting in their test’s
- (void)setUp method:
In Objective-C:
objc
// Disable analytics.
[[GREYConfiguration sharedInstance] setValue:@(NO) forConfigKey:kGREYConfigKeyAnalyticsEnabled];
In Swift:
swift
// Disable analytics.
GREYConfiguration.sharedInstance().setValue(false, forConfigKey: kGREYConfigKeyAnalyticsEnabled)
For Contributors
Please make sure you’ve followed the guidelines in
CONTRIBUTING.md before making any contributions.
Setup an EarlGrey Project
1. Clone the EarlGrey repository from GitHub:
git clone https://github.com/google/EarlGrey.git
2. After you have clTop issues
#1015EarlGrey 1 iOS13 compatibility?23 comments · 2019-08-16#733Not able to execute on Xcode 10 beta 22 comments · 2018-07-09#508why my test case always timeout exception on iOS 8.0~9.3, but works well on iOS10.1 ?20 comments · 2017-05-18#1187Running Xcode Generated UITest Crashes on eDistantObject`SetupBlockInvocationForward 17 comments · 2020-02-07#1042How to restart app before every test case and test suite in EarlGrey?17 comments · 2019-09-15#436Waiting for UIView's draw/layout pass to complete17 comments · 2017-02-21#1357Internal private APIs are now marked as "direct" in iOS 1416 comments · 2020-06-23#1043Not able to select an UITabBarButton in iOS 1315 comments · 2019-09-16
Latest release
2.2.2 2.2.2 2022-06-072.2.2 (06/3/2022) Baseline: [a430608] + [a430608]: Update AppStateTracker logs. Enhancements Sanitizers are now supported with EarlGrey. Test-side screenshots are generated for a test failure. WKWebView has an idling resource added for it. Improved logging with GREYLogger for debugging. Some cursory support has been added for matching SwiftUI views. Bug fixes Multiple fixes for iOS 15 related to scrolling, window synchronization etc. Compatibility EarlGrey has been tested for working till Xcode version 13.4 and Swift 5. Known Issues EarlGrey does not tra