We are using [tester tapViewWithAccessibilityLabel:@"Search"]; to select a UISearchBar that is present in a UITableViewController.
However, recently this method has started to fail with the following error View is not tappable.
I did some digging and found where the problem appears to be happening, I'm just not really sure what the right fix is, that's where you guys come in.
First of all, here is a screenshot of the view we are talking about:
While in this view I issue the [tester tapViewWithAccessibilityLabel:@"Search"]; command, and I stepped down through to where tappablePointInRect (https://github.com/kif-framework/KIF/blob/master/Additions/UIView-KIFAdditions.m#L528) gets called on the frame of the UIAccessibilityElement that was successfully found. the CGPoint that get's returned is NaN, NaN which is what I believe is causing the problem.
It looks like this is because we are actually grabbing the search view from a previous view (which is why it is removed from the view when we try to tap it).
We are using
[tester tapViewWithAccessibilityLabel:@"Search"];
to select a UISearchBar that is present in a UITableViewController.However, recently this method has started to fail with the following error
View is not tappable
.I did some digging and found where the problem appears to be happening, I'm just not really sure what the right fix is, that's where you guys come in.
First of all, here is a screenshot of the view we are talking about:
While in this view I issue the
[tester tapViewWithAccessibilityLabel:@"Search"];
command, and I stepped down through to where tappablePointInRect (https://github.com/kif-framework/KIF/blob/master/Additions/UIView-KIFAdditions.m#L528) gets called on the frame of the UIAccessibilityElement that was successfully found. the CGPoint that get's returned is NaN, NaN which is what I believe is causing the problem.I did some further digging and found out that the very first line of that method (https://github.com/kif-framework/KIF/blob/master/Additions/UIView-KIFAdditions.m#L531) calls
CGRect frame = [self.window convertRect:rect fromView:self];
but after inspecting this,self.window
is nil, and therefore the returned frame is 0,0,0,0Should the
window
property of a UISearchBar be nil? This appears to be what is causing the problem. Any thoughts or suggestions are appreciated.