GREYFailureHandler

@protocol GREYFailureHandler <NSObject>

Protocol for handling failures (such as failure of actions and assertions) raised by EarlGrey.

  • Called by the framework to raise an exception.

    Declaration

    Objective-C

    - (void)handleException:(GREYFrameworkException *)exception
                    details:(NSString *)details;

    Swift

    func handle(_ exception: GREYFrameworkException!, details: String!)

    Parameters

    exception

    The exception to be handled.

    details

    Extra information about the failure.

  • Sets the file name and line number of operation that caused the failure.

    Declaration

    Objective-C

    - (void)setInvocationFile:(NSString *)fileName
            andInvocationLine:(NSUInteger)lineNumber;

    Swift

    optional func setInvocationFile(_ fileName: String!, andInvocationLine lineNumber: UInt)

    Parameters

    fileName

    The name of the file where the error happened.

    lineNumber

    The line number in the file that caused the error.