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:
If I put the accessibility label on the
UITableViewCell
KIF'sKIFUITestActor - waitForAccessibilityElement:view:withLabel:traits:tappable:
returns theUITableView
, not the cell. Somehow the table seems to inherit its only child's accessibility label and lets KIF encounter it first during its recursive search.If I put the accessibility label on the
UIButton
instead, KIF finds it but determines that is is not tappable (i.e.UIView-KIFAdditions -tappablePointInRect:
returnsNO
), presumably because its mainly transparent between the thin font lines for the button's label (the tap goes to aUITableViewCellContentView
instead).
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...
?