kif-framework / KIF

Keep It Functional - An iOS Functional Testing Framework
Other
6.21k stars 912 forks source link

stepToEnterText:intoViewWithAccessibilityLabel: taps middle scope button in UISearchBars #175

Closed percysnoodle closed 10 years ago

percysnoodle commented 11 years ago

I'm testing a screen which has a UISearchBar with three scope buttons, and whenever I use stepToEnterText:intoViewWithAccessibilityLabel: the middle scope button ends up selected. This seems to be because tappablePointInRect: is returning the centre of the view.

bnickel commented 11 years ago

It seems there is a lot of stuff I don't know about search bars. I'm thinking of setting up a test suite against them to tackle these kinds of issues.

bnickel commented 11 years ago

Accidentally closed.

bnickel commented 11 years ago

Take a look at my comments on issue #257. I've created a commit to address this issue. Rather than assigning an accessibilityLabel to your search field, it would allow you to access the search field text box directly with its text:

[tester enterText:@"Hello" intoViewWithAccessibilityLabel:nil traits:UIAccessibilityTraitSearchField expecting:@"Hello"]

You can test it out with:

pod 'KIF', :git => 'https://github.com/kif-framework/KIF.git', :commit => 'accae95'
phatmann commented 10 years ago

Closing all KIF 1 issues as it will no longer be maintained.