Inherits from KIFTestActor : NSObject
Declared in KIFUITestActor.h

Tasks

Instance Methods

choosePhotoInAlbum:atRow:column:

- (void)choosePhotoInAlbum:(NSString *)albumName atRow:(NSInteger)row column:(NSInteger)column
Discussion

This set of steps expects that the photo picker has been initiated and that the sheet is up. From there it will tap the “Choose Photo” button and select the desired photo.

Parameters

albumName

The name of the album to select the photo from.

row

The row number in the album for the desired photo.

column

The column number in the album for the desired photo.

Declared In

KIFUITestActor.h

clearTextFromAndThenEnterText:intoViewWithAccessibilityLabel:

- (void)clearTextFromAndThenEnterText:(NSString *)text intoViewWithAccessibilityLabel:(NSString *)label

clearTextFromAndThenEnterText:intoViewWithAccessibilityLabel:traits:expectedResult:

- (void)clearTextFromAndThenEnterText:(NSString *)text intoViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits expectedResult:(NSString *)expectedResult

clearTextFromViewWithAccessibilityLabel:

- (void)clearTextFromViewWithAccessibilityLabel:(NSString *)label

clearTextFromViewWithAccessibilityLabel:traits:

- (void)clearTextFromViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits

dismissPopover

- (void)dismissPopover
Discussion

With a popover up, tap at the top-left corner of the screen.

Declared In

KIFUITestActor.h

enterText:intoViewWithAccessibilityLabel:

- (void)enterText:(NSString *)text intoViewWithAccessibilityLabel:(NSString *)label
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, a tap event is simulated in the center of the view or element, then text is entered into the view by simulating taps on the appropriate keyboard keys.

Parameters

text

The text to enter.

label

The accessibility label of the element to type into.

Declared In

KIFUITestActor.h

enterText:intoViewWithAccessibilityLabel:traits:expectedResult:

- (void)enterText:(NSString *)text intoViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits expectedResult:(NSString *)expectedResult
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, a tap event is simulated in the center of the view or element, then text is entered into the view by simulating taps on the appropriate keyboard keys.

Parameters

text

The text to enter.

label

The accessibility label of the element to type into.

traits

The accessibility traits of the element to type into. Elements that do not include at least these traits are ignored.

expectedResult

What the text value should be after entry, including any formatting done by the field. If this is nil, the “text” parameter will be used.

Declared In

KIFUITestActor.h

enterTextIntoCurrentFirstResponder:

- (void)enterTextIntoCurrentFirstResponder:(NSString *)text
Discussion

Text is entered into the view by simulating taps on the appropriate keyboard keys if the keyboard is already displayed. Useful to enter text in UIWebViews or components with no accessibility labels.

Parameters

text

The text to enter.

Declared In

KIFUITestActor.h

longPressViewWithAccessibilityLabel:duration:

- (void)longPressViewWithAccessibilityLabel:(NSString *)label duration:(NSTimeInterval)duration
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, touch events are simulated in the center of the view or element.

Parameters

label

The accessibility label of the element to tap.

duration

The length of time to long press the element.

Declared In

KIFUITestActor.h

longPressViewWithAccessibilityLabel:value:duration:

- (void)longPressViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value duration:(NSTimeInterval)duration
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, touch events are simulated in the center of the view or element.

This variation allows finding a particular instance of an accessibility element. For example, a table view might have multiple elements with the accessibility label of “Employee”, but only one that also has the accessibility value of “Bob”.

Parameters

label

The accessibility label of the element to tap.

value

The accessibility value of the element to tap.

duration

The length of time to long press the element.

Declared In

KIFUITestActor.h

longPressViewWithAccessibilityLabel:value:traits:duration:

- (void)longPressViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits duration:(NSTimeInterval)duration
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, touch events are simulated in the center of the view or element.

This variation allows finding a particular instance of an accessibility element. For example, a table view might have multiple elements with the accessibility label of “Employee”, but only one that also has the accessibility value of “Bob”.

Parameters

label

The accessibility label of the element to tap.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to tap. Elements that do not include at least these traits are ignored.

duration

The length of time to long press the element.

Declared In

KIFUITestActor.h

moveRowAtIndexPath:toIndexPath:inTableViewWithAccessibilityIdentifier:

- (void)moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath inTableViewWithAccessibilityIdentifier:(NSString *)identifier
Discussion

This step will get the view with the specified accessibility identifier and move the row at sourceIndexPath to destinationIndexPath.

For cases where you may need to work from the end of a table view rather than the beginning, negative sections count back from the end of the table view (-1 is the last section) and negative rows count back from the end of the section (-1 is the last row for that section).

Parameters

sourceIndexPath

Index path of the row to move.

destinationIndexPath

Desired final index path of the row after moving.

identifier

Accessibility identifier of the table view.

Declared In

KIFUITestActor.h

scrollViewWithAccessibilityIdentifier:byFractionOfSizeHorizontal:vertical:

- (void)scrollViewWithAccessibilityIdentifier:(NSString *)identifier byFractionOfSizeHorizontal:(CGFloat)horizontalFraction vertical:(CGFloat)verticalFraction
Discussion

The view will get the view with the specified accessibility identifier and scroll it by the indicated fraction of its size, with the scroll centered on the center of the view.

Parameters

identifier

The accessibility identifier of the view to scroll.

horizontalFraction

The horizontal displacement of the scroll action, as a fraction of the width of the view.

verticalFraction

The vertical displacement of the scroll action, as a fraction of the height of the view.

Declared In

KIFUITestActor.h

scrollViewWithAccessibilityLabel:byFractionOfSizeHorizontal:vertical:

- (void)scrollViewWithAccessibilityLabel:(NSString *)label byFractionOfSizeHorizontal:(CGFloat)horizontalFraction vertical:(CGFloat)verticalFraction
Discussion

The view will get the view with the specified accessibility label and scroll it by the indicated fraction of its size, with the scroll centered on the center of the view.

Parameters

label

The accessibility label of the view to scroll.

horizontalFraction

The horizontal displacement of the scroll action, as a fraction of the width of the view.

verticalFraction

The vertical displacement of the scroll action, as a fraction of the height of the view.

Declared In

KIFUITestActor.h

selectPickerViewRowWithTitle:

- (void)selectPickerViewRowWithTitle:(NSString *)title
Discussion

With a picker view already visible, this step will find an item with the given title, select that item, and tap the Done button.

Parameters

title

The title of the row to select.

Declared In

KIFUITestActor.h

setOn:forSwitchWithAccessibilityLabel:

- (void)setOn:(BOOL)switchIsOn forSwitchWithAccessibilityLabel:(NSString *)label
Discussion

The UISwitch with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present, the step will return if it’s already in the desired position. If the switch is tappable but not in the desired position, a tap event is simulated in the center of the view or element, toggling the switch into the desired position.

Parameters

switchIsOn

The desired position of the UISwitch.

label

The accessibility label of the element to switch.

Declared In

KIFUITestActor.h

setValue:forSliderWithAccessibilityLabel:

- (void)setValue:(float)value forSliderWithAccessibilityLabel:(NSString *)label
Discussion

The UISlider with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present, the step will attempt to drag the slider to the new value. The step will fail if it finds a view with the given accessibility label that is not a UISlider or if value is outside of the possible values. Because this step simulates drag events, the value reached may not be the exact value requested and the app may ignore the touch events if the movement is less than the drag gesture recognizer’s minimum distance.

Parameters

value

The desired value of the UISlider.

label

The accessibility label of the element to drag.

Declared In

KIFUITestActor.h

swipeViewWithAccessibilityLabel:inDirection:

- (void)swipeViewWithAccessibilityLabel:(NSString *)label inDirection:(KIFSwipeDirection)direction
Discussion

The view will get the view with the specified accessibility label and swipe the screen in the given direction from the view’s center.

Parameters

label

The accessibility label of the view to swipe.

direction

The direction in which to swipe.

Declared In

KIFUITestActor.h

tapAccessibilityElement:inView:

- (void)tapAccessibilityElement:(UIAccessibilityElement *)element inView:(UIView *)view
Discussion

Unlike the -tapViewWithAccessibilityLabel: family of methods, this method allows you to tap an arbitrary element. Combined with -waitForAccessibilityElement:view:withLabel:value:traits:tappable: or [UIAccessibilityElement accessibilityElement:view:withLabel:value:traits:tappable:error:] this provides an opportunity for more complex logic.

Parameters

element

The accessibility element to tap.

view

The view containing the accessibility element.

Declared In

KIFUITestActor.h

tapItemAtIndexPath:inCollectionViewWithAccessibilityIdentifier:

- (void)tapItemAtIndexPath:(NSIndexPath *)indexPath inCollectionViewWithAccessibilityIdentifier:(NSString *)identifier
Discussion

This step will get the view with the specified accessibility identifier and tap the item at indexPath.

For cases where you may need to work from the end of a collection view rather than the beginning, negative sections count back from the end of the collection view (-1 is the last section) and negative items count back from the end of the section (-1 is the last item for that section).

Parameters

indexPath

Index path of the item to tap.

identifier

Accessibility identifier of the collection view.

Declared In

KIFUITestActor.h

tapRowAtIndexPath:inTableViewWithAccessibilityIdentifier:

- (void)tapRowAtIndexPath:(NSIndexPath *)indexPath inTableViewWithAccessibilityIdentifier:(NSString *)identifier
Discussion

This step will get the view with the specified accessibility identifier and tap the row at indexPath.

For cases where you may need to work from the end of a table view rather than the beginning, negative sections count back from the end of the table view (-1 is the last section) and negative rows count back from the end of the section (-1 is the last row for that section).

Parameters

indexPath

Index path of the row to tap.

identifier

Accessibility identifier of the table view.

Declared In

KIFUITestActor.h

tapRowInTableViewWithAccessibilityLabel:atIndexPath:

- (void)tapRowInTableViewWithAccessibilityLabel:(NSString *)tableViewLabel atIndexPath:(NSIndexPath *)indexPath
Discussion

This step will get the view with the specified accessibility label and tap the row at indexPath.

For cases where you may need to work from the end of a table view rather than the beginning, negative sections count back from the end of the table view (-1 is the last section) and negative rows count back from the end of the section (-1 is the last row for that section).

Parameters

tableViewLabel

Accessibility label of the table view.

indexPath

Index path of the row to tap.

Declared In

KIFUITestActor.h

tapScreenAtPoint:

- (void)tapScreenAtPoint:(CGPoint)screenPoint
Discussion

Taps the screen at a specific point. In general you should use the factory steps that tap a view based on its accessibility label, but there are situations where it’s not possible to access a view using accessibility mechanisms. This step is more lenient than the steps that use the accessibility label, and does not wait for any particular view to appear, or validate that the tapped view is enabled or has interaction enabled. Because this step doesn’t doesn’t validate that a view is present before tapping it, it’s good practice to precede this step where possible with a waitForViewWithAccessibilityLabel: with the label for another view that should appear on the same screen.

Parameters

screenPoint

The point in screen coordinates to tap. Screen points originate from the top left of the screen.

Declared In

KIFUITestActor.h

tapStatusBar

- (void)tapStatusBar

tapViewWithAccessibilityLabel:

- (void)tapViewWithAccessibilityLabel:(NSString *)label
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, a tap event is simulated in the center of the view or element.

Parameters

label

The accessibility label of the element to tap.

Declared In

KIFUITestActor.h

tapViewWithAccessibilityLabel:traits:

- (void)tapViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, a tap event is simulated in the center of the view or element.

Parameters

label

The accessibility label of the element to tap.

traits

The accessibility traits of the element to tap. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

tapViewWithAccessibilityLabel:value:traits:

- (void)tapViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Once the view is present and tappable, a tap event is simulated in the center of the view or element.

This variation allows finding a particular instance of an accessibility element. For example, a table view might have multiple elements with the accessibility label of “Employee”, but only one that also has the accessibility value of “Bob”.

Parameters

label

The accessibility label of the element to tap.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to tap. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForAbsenceOfViewWithAccessibilityLabel:

- (void)waitForAbsenceOfViewWithAccessibilityLabel:(NSString *)label
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element is found, then the step will attempt to wait until it isn’t. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are considered absent.

Parameters

label

The accessibility label of the element to wait for.

Declared In

KIFUITestActor.h

waitForAbsenceOfViewWithAccessibilityLabel:traits:

- (void)waitForAbsenceOfViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element is found, then the step will attempt to wait until it isn’t. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are considered absent.

Parameters

label

The accessibility label of the element to wait for.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForAbsenceOfViewWithAccessibilityLabel:value:traits:

- (void)waitForAbsenceOfViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element is found, then the step will attempt to wait until it isn’t. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are considered absent.

Parameters

label

The accessibility label of the element to wait for.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForAccessibilityElement:view:withElementMatchingPredicate:tappable:

- (void)waitForAccessibilityElement:(UIAccessibilityElement **)element view:(out UIView **)view withElementMatchingPredicate:(NSPredicate *)predicate tappable:(BOOL)mustBeTappable

waitForAccessibilityElement:view:withIdentifier:tappable:

- (void)waitForAccessibilityElement:(UIAccessibilityElement **)element view:(out UIView **)view withIdentifier:(NSString *)identifier tappable:(BOOL)mustBeTappable

waitForAccessibilityElement:view:withLabel:value:traits:tappable:

- (void)waitForAccessibilityElement:(UIAccessibilityElement **)element view:(out UIView **)view withLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits tappable:(BOOL)mustBeTappable

waitForCellAtIndexPath:inCollectionViewWithAccessibilityIdentifier:

- (UICollectionViewCell *)waitForCellAtIndexPath:(NSIndexPath *)indexPath inCollectionViewWithAccessibilityIdentifier:(NSString *)identifier
Discussion

This step will get the view with the specified accessibility identifier and then get the cell at indexPath.

For cases where you may need to work from the end of a collection view rather than the beginning, negative sections count back from the end of the collection view (-1 is the last section) and negative items count back from the end of the section (-1 is the last item for that section).

Parameters

indexPath

Index path of the item to tap.

identifier

Accessibility identifier of the collection view.

Return Value

Collection view cell at index path

Declared In

KIFUITestActor.h

waitForCellAtIndexPath:inTableViewWithAccessibilityIdentifier:

- (UITableViewCell *)waitForCellAtIndexPath:(NSIndexPath *)indexPath inTableViewWithAccessibilityIdentifier:(NSString *)identifier
Discussion

This step will get the view with the specified accessibility identifier and then get the cell at the indexPath.

For cases where you may need to work from the end of a table view rather than the beginning, negative sections count back from the end of the table view (-1 is the last section) and negative rows count back from the end of the section (-1 is the last row for that section).

Parameters

indexPath

Index path of the cell.

identifier

Accessibility identifier of the table view.

Return Value

Table view cell at index path

Declared In

KIFUITestActor.h

waitForFirstResponderWithAccessibilityLabel:

- (void)waitForFirstResponderWithAccessibilityLabel:(NSString *)label
Discussion

The first responder is found by searching the view hierarchy of the application’s main window and its accessibility label is compared to the given value. If they match, the step returns success else it will attempt to wait until they do.

Parameters

label

The accessibility label of the element to wait for.

Declared In

KIFUITestActor.h

waitForFirstResponderWithAccessibilityLabel:traits:

- (void)waitForFirstResponderWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits
Discussion

The first responder is found by searching the view hierarchy of the application’s main window and its accessibility label is compared to the given value. If they match, the step returns success else it will attempt to wait until they do.

Parameters

label

The accessibility label of the element to wait for.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForTappableViewWithAccessibilityLabel:

- (UIView *)waitForTappableViewWithAccessibilityLabel:(NSString *)label
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Whether or not a view is tappable is based on [UIView hitTest:].

Parameters

label

The accessibility label of the element to wait for.

Declared In

KIFUITestActor.h

waitForTappableViewWithAccessibilityLabel:traits:

- (UIView *)waitForTappableViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Whether or not a view is tappable is based on [UIView hitTest:].

Parameters

label

The accessibility label of the element to wait for.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForTappableViewWithAccessibilityLabel:value:traits:

- (UIView *)waitForTappableViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is searched for in the view hierarchy. If the element isn’t found or isn’t currently tappable, then the step will attempt to wait until it is. Whether or not a view is tappable is based on [UIView hitTest:].

Parameters

label

The accessibility label of the element to wait for.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForViewWithAccessibilityLabel:

- (UIView *)waitForViewWithAccessibilityLabel:(NSString *)label
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element isn’t found, then the step will attempt to wait until it is. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are ignored.

If the view you want to wait for is tappable, use the waitForTappableViewWithAccessibilityLabel: methods instead as they provide a more strict test.

Parameters

label

The accessibility label of the element to wait for.

Declared In

KIFUITestActor.h

waitForViewWithAccessibilityLabel:traits:

- (UIView *)waitForViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element isn’t found, then the step will attempt to wait until it is. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are ignored.

If the view you want to wait for is tappable, use the waitForTappableViewWithAccessibilityLabel: methods instead as they provide a more strict test.

Parameters

label

The accessibility label of the element to wait for.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Declared In

KIFUITestActor.h

waitForViewWithAccessibilityLabel:value:traits:

- (UIView *)waitForViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits
Discussion

The view or accessibility element with the given label is found in the view hierarchy. If the element isn’t found, then the step will attempt to wait until it is. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are ignored.

If the view you want to wait for is tappable, use the waitForTappableViewWithAccessibilityLabel: methods instead as they provide a more strict test.

Parameters

label

The accessibility label of the element to wait for.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

Return Value

A configured test step.

Declared In

KIFUITestActor.h