iosuitableviewuibuttonuiaccessibilitykif

KIF cannot tap UIButton inside UITableViewCell if it's its UITableView's only one


I am having trouble automating tapping on an UIButton that is embedded inside a UITableViewCell if that cell is the table's only one. This is in the context of UI automation with KIF.

Here my relavant call:

[tester tapViewWithAccessibilityLabel: @"LABEL"
                               traits: UIAccessibilityTraitButton];
                               // trait only specified for 2nd case below

Here is what I am observing:

A workaround might be tapping on the row by it's NSIndexPath but maybe there is still a better way to overcome the described hurdles I am facing. So how could I instruct KIF to tap a button like this with a call to tapView...?


Solution

  • This is just to confirm that this workaround is applicable:

    [tester tapRowAtIndexPath: [NSIndexPath indexPathForRow: 0 inSection: 0] 
    inTableViewWithAccessibilityIdentifier: @"IDENTIFIER"];