Constants
The following constants are available globally.
-
Key for currently set failure handler for EarlGrey in thread’s local storage dictionary.
Declaration
Objective-C
extern NSString *const kGREYFailureHandlerKey
-
Error domain for keyboard dismissal.
Declaration
Objective-C
extern NSString *const kGREYKeyboardDismissalErrorDomain
-
Configuration that enables or disables usage tracking for the framework.
Accepted values: @c BOOL (i.e. @c YES or @c NO) Default value: @c YES
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyAnalyticsEnabled
-
Configuration that enables or disables constraint checks before performing an action.
Accepted values: @c BOOL (i.e. @c YES or @c NO) Default value: @c YES
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyActionConstraintsEnabled
-
Configuration that holds timeout duration (in seconds) for actions and assertions. Actions or assertions that are not scheduled within this time will fail with a timeout. If the action or assertion starts within the timeout duration and if a search action is provided, then the search action will execute at least once regardless of the timeout duration.
Accepted values: @c double (negative values are invalid) Default value: 30.0
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyInteractionTimeoutDuration
-
Configuration that enables or disables EarlGrey’s synchronization feature. When disabled, any command that used to wait for the app to idle before proceeding will no longer do so.
@remark For more fine-grained control over synchronization parameters, you can tweak other provided configuration options below.
Accepted values: @c BOOL (i.e. @c YES or @c NO) Default value: @c YES
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeySynchronizationEnabled
-
Configuration for setting the max interval (in seconds) of non-repeating NSTimers that EarlGrey will automatically track.
Accepted values: @c double (negative values are invalid) Default value: 1.5
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyNSTimerMaxTrackableInterval
-
Configuration for setting the max delay (in seconds) for dispatch_after and dispatch_after_f calls that EarlGrey will automatically track. dispatch_after and dispatch_after_f calls exceeding the specified time won’t be tracked by the framework.
Accepted values: @c double (negative values are invalid) Default value: 1.5
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyDispatchAfterMaxTrackableDelay
-
Configuration for setting the max duration (in seconds) for delayed executions on the main thread originating from any performSelector:afterDelay invocations that EarlGrey will automatically track.
Accepted values: @c double (negative values are invalid) Default value: 1.5
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyDelayedPerformMaxTrackableDuration
-
Configuration that determines whether or not CALayer animations are modified. If @c YES, then cyclic animations are set to run only once and the animation duration is limited to a maximum of @c kGREYConfigKeyCALayerMaxAnimationDuration.
@remark This should only be used if synchronization is disabled; otherwise cyclic animations will cause EarlGrey to timeout and fail tests.
Accepted values: @c BOOL (i.e. @c YES or @c NO) Default value: @c YES
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyCALayerModifyAnimations
-
Configuration for setting max allowable animation duration (in seconds) for any CALayer based animation. Animations exceeding the specified time will have their duration truncated to value specified by this config.
Accepted values: @c double (negative values are invalid) Default value: 10.0
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyCALayerMaxAnimationDuration
-
Configuration that holds regular expressions for URLs that are blacklisted from synchronization. EarlGrey will not wait for any network request with URLs matching the blacklisted regular expressions to complete. Most frequently blacklisted URLs include those used for sending analytics, pingbacks, and background network tasks that don’t interfere with testing.
@remark By default, EarlGrey will not synchronize with any URLs with
data
scheme.Accepted values: @c An @c NSArray of valid regular expressions as @c NSString. The strings must be accepted by @c NSRegularExpression. Default value: an empty @c NSArray
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyURLBlacklistRegex
-
Configuration that enables/disables inclusion of status bar window in every operation performed by EarlGrey. By default, the status bar window is excluded from screenshots and UI hierarchy.
Accepted values: @c BOOL (i.e. @c YES or @c NO) Default value: NO
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyIncludeStatusBarWindow
-
Configuration for setting a directory location where any test artifacts such as screenshots, test logs, etc. are stored. The user should ensure that the location provided is writable by the test.
Accepted values: NSString containing a valid absolute filepath that is writable by the test. Default value: @c nil
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConfigKeyArtifactsDirLocation
-
Any alpha less than this value is considered hidden by Apple. @see https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instm/UIView/hitTest:withEvent:
Declaration
Objective-C
extern const CGFloat kGREYMinimumVisibleAlpha
-
Amount of time a
fast
swipe should last for, in seconds.Declaration
Objective-C
extern const CFTimeInterval kGREYSwipeFastDuration
-
Amount of time a
slow
swipe should last for, in seconds.Declaration
Objective-C
extern const CFTimeInterval kGREYSwipeSlowDuration
-
Amount of time a
fast
pinch should last for, in secondsDeclaration
Objective-C
extern const CFTimeInterval kGREYPinchFastDuration
-
Amount of time a
slow
pinch should last for, in secondsDeclaration
Objective-C
extern const CFTimeInterval kGREYPinchSlowDuration
-
Infinite timeout.
Declaration
Objective-C
extern const CFTimeInterval kGREYInfiniteTimeout
-
Limit on the number of UIPickerViews that can be pulled for getting the hierarchy.
Declaration
Objective-C
extern const NSInteger kUIPickerViewMaxAccessibilityViews
-
Amount of time a normal long press should last for, in seconds. Extracted from: @see https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UILongPressGestureRecognizer_Class/index.html#//apple_ref/occ/instp/UILongPressGestureRecognizer/minimumPressDuration
Declaration
Objective-C
extern const CFTimeInterval kGREYLongPressDefaultDuration
-
Minimum acceptable difference between two floating-point values when comparing them.
Declaration
Objective-C
extern const CGFloat kGREYAcceptableFloatDifference
-
NSUserDefaults key for checking if verbose logging is turned on. (i.e. logs with GREYLogVerbose are printed.)
Declaration
Objective-C
extern NSString *const kGREYAllowVerboseLogging
-
The default pinch angle for the pinch action, specified by an approximate angle for a right handed two finger pinch.
Declaration
Objective-C
extern const double kGREYPinchAngleDefault
-
Generic framework failure.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYGenericFailureException
-
Thrown on action failure.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYActionFailedException
-
Thrown on assertion failure.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYAssertionFailedException
-
Thrown when assertion failed due to an unexpected @c nil parameter.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYNilException
-
Thrown when assertion failed due to an unexpected non-nil parameter.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYNotNilException
-
Thrown by the selection API when no UI element matches the selection matcher.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYNoMatchingElementException
-
Thrown by the interaction API when either an action or assertion matcher matches multiple elements in the UI hierarchy.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYMultipleElementsFoundException
-
Thrown by the interaction API when either an action or assertion times out waiting for the app to become idle.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYTimeoutException
-
Thrown by the action API when the constraints required for performing the action are not satisfied.
Declaration
Objective-C
extern NSString *const _Nonnull kGREYConstraintFailedException
-
Error domain for element interaction failures.
Declaration
Objective-C
extern NSString *const kGREYInteractionErrorDomain
-
Notification name for when an action will be performed. The action itself is contained in the @c userInfo object from the @c notification and can be obtained using the key @c kGREYActionUserInfoKey.
Declaration
Objective-C
extern NSString *const kGREYWillPerformActionNotification
-
Notification name for when an action has been performed. The action itself is contained in the @c userInfo object from the @c notification and can be obtained using the key @c kGREYActionUserInfoKey.
Declaration
Objective-C
extern NSString *const kGREYDidPerformActionNotification
-
Notification name for when an assertion will be checked. The assertion itself is contained in the @c userInfo object from the @c notification and can be obtained using the key @c kGREYAssertionUserInfoKey.
Declaration
Objective-C
extern NSString *const kGREYWillPerformAssertionNotification
-
Notification name for when an assertion has been performed. The assertion itself is contained in the @c userInfo object from the @c notification and can be obtained using the key @c kGREYAssertionUserInfoKey.
Declaration
Objective-C
extern NSString *const kGREYDidPerformAssertionNotification
-
User Info dictionary key for the action performed.
Declaration
Objective-C
extern NSString *const kGREYActionUserInfoKey
-
User Info dictionary key for the element an action was performed on. The element for an assertion can be @c nil in case of an error.
Declaration
Objective-C
extern NSString *const kGREYActionElementUserInfoKey
-
User Info dictionary key for any error populated on the action being performed.
Declaration
Objective-C
extern NSString *const kGREYActionErrorUserInfoKey
-
User Info dictionary key for the assertion checked.
Declaration
Objective-C
extern NSString *const kGREYAssertionUserInfoKey
-
User Info dictionary key for the element an assertion was checked on. The element for an assertion can be @c nil since assertions can be performed on @c nil elements.
Declaration
Objective-C
extern NSString *const kGREYAssertionElementUserInfoKey
-
User Info dictionary key for any error populated on the assertion being checked.
Declaration
Objective-C
extern NSString *const kGREYAssertionErrorUserInfoKey
-
The Error domain for a scroll error.
Declaration
Objective-C
extern NSString *const kGREYScrollErrorDomain
-
Error domain for thread executor failures.
Declaration
Objective-C
extern NSString *const kGREYUIThreadExecutorErrorDomain