Inherits from KIFTestActor : NSObject
Declared in KIFUITestActor.h

Tasks

Other Methods

ConditionalTests Methods

IdentifierTests Methods

Instance Methods

acknowledgeSystemAlert

- (void)acknowledgeSystemAlert
Discussion

Use this to dissmiss a location services authorization dialog or a photos access dialog by tapping the ‘Allow’ button. No action is taken if no alert is present.

Declared In

KIFUITestActor.h

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. (1-indexed)

row

The row number in the album for the desired photo. (1-indexed)

column

The column number in the album for the desired photo.

Declared In

KIFUITestActor.h

clearTextFromAndThenEnterText:intoViewWithAccessibilityIdentifier:

- (void)clearTextFromAndThenEnterText:(NSString *)text intoViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier

clearTextFromAndThenEnterText:intoViewWithAccessibilityIdentifier:expectedResult:

- (void)clearTextFromAndThenEnterText:(NSString *)text intoViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier expectedResult:(NSString *)expectedResult

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

clearTextFromAndThenEnterTextIntoCurrentFirstResponder:

- (void)clearTextFromAndThenEnterTextIntoCurrentFirstResponder:(NSString *)text

clearTextFromElement:inView:

- (void)clearTextFromElement:(UIAccessibilityElement *)element inView:(UIView *)view

clearTextFromFirstResponder

- (void)clearTextFromFirstResponder

clearTextFromViewWithAccessibilityIdentifier:

- (void)clearTextFromViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier

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:intoViewWithAccessibilityIdentifier:

- (void)enterText:(NSString *)text intoViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier
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.

accessibilityIdentifier

The accessibility identifier of the element to type into.

Declared In

KIFUITestActor-IdentifierTests.h

enterText:intoViewWithAccessibilityIdentifier:expectedResult:

- (void)enterText:(NSString *)text intoViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier 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.

accessibilityIdentifier

The accessibility identifier of the element to type into.

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-IdentifierTests.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

enterTextIntoCurrentFirstResponder:fallbackView:

- (void)enterTextIntoCurrentFirstResponder:(NSString *)text fallbackView:(UIView *)fallbackView

expectView:toContainText:

- (void)expectView:(UIView *)view toContainText:(NSString *)expectedResult

longPressAccessibilityElement:inView:duration:

- (void)longPressAccessibilityElement:(UIAccessibilityElement *)element inView:(UIView *)view duration:(NSTimeInterval)duration

longPressViewWithAccessibilityIdentifier:duration:

- (void)longPressViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier 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

accessibilityIdentifier

The accessibility identifier of the element to tap.

duration

The length of time to long press the element.

Declared In

KIFUITestActor-IdentifierTests.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

selectDatePickerValue:

- (void)selectDatePickerValue:(NSArray *)datePickerColumnValues
Discussion

With a date picker view already visible, this step will select the different rotating weel values in order of how the array parameter is passed in. After it is done it will hide the date picker. It works with all 4 UIDatePickerMode modes. The input parameter of type NSArray has to match in what order the date picker is displaying the values/columns. So if the locale is changing the input parameter has to be adjusted. Example: Mode: UIDatePickerModeDate, Locale: en_US, Input param: NSArray date = @[@“June”, @“17”, @“1965”];. Example: Mode: UIDatePickerModeDate, Locale: de_DE, Input param: NSArray *date = @[@“17.”, @“Juni”, @“1965”.

Parameters

datePickerColumnValues

Each element in the NSArray represents a rotating wheel in the date picker control. Elements from 0 - n are listed in the order of the rotating wheels, left to right.

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

selectPickerViewRowWithTitle:inComponent:

- (void)selectPickerViewRowWithTitle:(NSString *)title inComponent:(NSInteger)component
Discussion

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

Parameters

title

The title of the row to select.

component

The component tester inteds to select the title in.

Declared In

KIFUITestActor.h

setOn:forSwitchWithAccessibilityIdentifier:

- (void)setOn:(BOOL)switchIsOn forSwitchWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier
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.

accessibilityIdentifier

The accessibility identifier of the element to switch.

Declared In

KIFUITestActor-IdentifierTests.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:forSlider:

- (void)setValue:(float)value forSlider:(UISlider *)slider

setValue:forSliderWithAccessibilityIdentifier:

- (void)setValue:(float)value forSliderWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier
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.

accessibilityIdentifier

The accessibility identifier of the element to drag.

Declared In

KIFUITestActor-IdentifierTests.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

swipeViewWithAccessibilityLabel:value:inDirection:

- (void)swipeViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value 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.

value

The accessibility value of the view to swipe.

direction

The direction in which to swipe.

Declared In

KIFUITestActor.h

swipeViewWithAccessibilityLabel:value:traits:inDirection:

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

This step 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.

value

The accessibility value of the view to swipe.

traits

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

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

tapViewWithAccessibilityIdentifier:

- (void)tapViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier

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

tryFindingAccessibilityElement:view:withElementMatchingPredicate:tappable:error:

- (BOOL)tryFindingAccessibilityElement:(out UIAccessibilityElement **)element view:(out UIView **)view withElementMatchingPredicate:(NSPredicate *)predicate tappable:(BOOL)mustBeTappable error:(out NSError **)error

tryFindingAccessibilityElement:view:withIdentifier:tappable:error:

- (BOOL)tryFindingAccessibilityElement:(out UIAccessibilityElement **)element view:(out UIView **)view withIdentifier:(NSString *)identifier tappable:(BOOL)mustBeTappable error:(out NSError **)error

tryFindingTappableViewWithAccessibilityLabel:error:

- (BOOL)tryFindingTappableViewWithAccessibilityLabel:(NSString *)label error:(out NSError **)error
Discussion

The view or accessibility element with the given label is searched in the view hierarchy. If the element isn’t found, then NO is returned. 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.

Parameters

label

The accessibility label of the element to wait for.

Declared In

KIFUITestActor-ConditionalTests.h

tryFindingTappableViewWithAccessibilityLabel:traits:error:

- (BOOL)tryFindingTappableViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits error:(out NSError **)error
Discussion

The view or accessibility element with the given label is searched in the view hierarchy. If the element isn’t found, then NO is returned. 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.

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-ConditionalTests.h

tryFindingTappableViewWithAccessibilityLabel:value:traits:error:

- (BOOL)tryFindingTappableViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits error:(out NSError **)error
Discussion

The view or accessibility element with the given label is searched in the view hierarchy. If the element isn’t found, then NO is returned. 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.

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-ConditionalTests.h

tryFindingViewWithAccessibilityLabel:error:

- (BOOL)tryFindingViewWithAccessibilityLabel:(NSString *)label error:(out NSError **)error
Discussion

The view or accessibility element with the given label is searched in the view hierarchy. If the element isn’t found, then NO is returned. 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.

Parameters

label

The accessibility label of the element to wait for.

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

Declared In

KIFUITestActor-ConditionalTests.h

tryFindingViewWithAccessibilityLabel:traits:error:

- (BOOL)tryFindingViewWithAccessibilityLabel:(NSString *)label traits:(UIAccessibilityTraits)traits error:(out NSError **)error
Discussion

The view or accessibility element with the given label is searched in the view hierarchy. If the element isn’t found, then NO is returned. 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.

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-ConditionalTests.h

tryFindingViewWithAccessibilityLabel:value:traits:error:

- (BOOL)tryFindingViewWithAccessibilityLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits error:(out NSError **)error
Discussion

The view or accessibility element with the given label is searched in the view hierarchy. If the element isn’t found, then NO is returned. 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.

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-ConditionalTests.h

waitForAbsenceOfKeyboard

- (void)waitForAbsenceOfKeyboard

waitForAbsenceOfSoftwareKeyboard

If present, waits for the software keyboard to dismiss.

- (void)waitForAbsenceOfSoftwareKeyboard

Declared In

KIFUITestActor.h

waitForAbsenceOfViewWithAccessibilityIdentifier:

- (void)waitForAbsenceOfViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier

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
Discussion

This method provides a more verbose API for achieving what is available in the waitForView/waitForTappableView family of methods, exposing both the found element and its containing view. The results can be used in other methods such as @c tapAccessibilityElement:inView:

This method provides more flexability than @c waitForAccessibilityElement:view:withLabel:value:traits:tappable: but less precise error messages. This message will tell you why the method failed but not whether or not the element met some of the criteria.

Parameters

element

To be populated with the matching accessibility element when found. Can be NULL.

view

To be populated with the matching view when found. Can be NULL.

predicate

The predicate to match.

mustBeTappable

If YES, only an element that can be tapped on will be returned.

Declared In

KIFUITestActor.h

waitForAccessibilityElement:view:withIdentifier:tappable:

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

This method provides a more verbose API for achieving what is available in the waitForView/waitForTappableView family of methods, exposing both the found element and its containing view. The results can be used in other methods such as @c tapAccessibilityElement:inView:

Parameters

element

To be populated with the matching accessibility element when found. Can be NULL.

view

To be populated with the matching view when found. Can be NULL.

identifier

The accessibility identifier of the element to wait for.

mustBeTappable

If YES, only an element that can be tapped on will be returned.

Declared In

KIFUITestActor.h

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
Discussion

This method provides a more verbose API for achieving what is available in the waitForView/waitForTappableView family of methods, exposing both the found element and its containing view. The results can be used in other methods such as @c tapAccessibilityElement:inView:

Parameters

element

To be populated with the matching accessibility element when found. Can be NULL.

view

To be populated with the matching view when found. Can be NULL.

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.

mustBeTappable

If YES, only an element that can be tapped on will be returned.

Declared In

KIFUITestActor.h

waitForAnimationsToFinish

Tries to guess if there are any unfinished animations and waits for a certain amount of time to let them finish.

- (void)waitForAnimationsToFinish

Declared In

KIFUITestActor.h

waitForAnimationsToFinishWithTimeout:

Tries to guess if there are any unfinished animations and waits for a certain amount of time to let them finish.

- (void)waitForAnimationsToFinishWithTimeout:(NSTimeInterval)timeout

Parameters

timeout

The maximum duration the method waits to let the animations finish.

Declared In

KIFUITestActor.h

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

waitForFirstResponderWithAccessibilityIdentifier:

- (void)waitForFirstResponderWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier
Discussion

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

Parameters

accessibilityIdentifier

The accessibility identifier of the element to wait for.

Declared In

KIFUITestActor-IdentifierTests.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

waitForKeyInputReady

Waits for the keyboard to be ready for input. This tests whether or not a hardware or software keyboard is available and if the keyboard has a responder to send events to.

- (void)waitForKeyInputReady

Declared In

KIFUITestActor.h

waitForKeyboard

- (void)waitForKeyboard

waitForSoftwareKeyboard

- (void)waitForSoftwareKeyboard
Discussion

If input is also possible from a hardare keyboard @c waitForKeyInputReady may be more appropriate.

Declared In

KIFUITestActor.h

waitForTappableViewWithAccessibilityIdentifier:

- (UIView *)waitForTappableViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier

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

waitForViewWithAccessibilityIdentifier:

- (UIView *)waitForViewWithAccessibilityIdentifier:(NSString *)accessibilityIdentifier

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