GREYActionBlock

@interface GREYActionBlock : GREYBaseAction

A class for creating block based GREYAction.

  • Creates a GREYAction that performs the action in the provided @c block.

    Declaration

    Objective-C

    + (instancetype)actionWithName:(NSString *)name
                      performBlock:(GREYPerformBlock)block;

    Swift

    class func action(withName name: Any!, performBlock block: Any!) -> Self!

    Parameters

    name

    The name of the action

    block

    A block that contains the action to execute.

    Return Value

    A GREYActionBlock instance with the given name.

  • Creates a GREYAction that performs the action in the provided @c block subject to the provided @c constraints.

    Declaration

    Objective-C

    + (instancetype)actionWithName:(NSString *)name
                       constraints:(id<GREYMatcher>)constraints
                      performBlock:(GREYPerformBlock)block;

    Parameters

    name

    The name of the action.

    constraints

    Constraints that must be satisfied before the action is performed This is optional and can be @c nil.

    block

    A block that contains the action to execute.

    Return Value

    A GREYActionBlock instance with the given name and constraints.

  • @remark init is not an available initializer. Use the other initializers.

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()
  • @remark initWithName::constraints: is overridden from its superclass.

    Declaration

    Objective-C

    - (instancetype)initWithName:(NSString *)name
                     constraints:(id<GREYMatcher>)constraints;
  • Designated Initializer.

    Declaration

    Objective-C

    - (instancetype)initWithName:(NSString *)name
                     constraints:(id<GREYMatcher>)constraints
                    performBlock:(GREYPerformBlock)block;

    Parameters

    name

    The name of the action.

    constraints

    Constraints that must be satisfied before the action is performed This is optional and can be @c nil.

    block

    A block that contains the action to execute.

    Return Value

    A GREYActionBlock instance with the given name and constraints.