Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

31375101: UITableViewDelegate method called with indexPath=nil when running UI tests #17177

Open
openradar-mirror opened this issue Mar 31, 2017 · 0 comments
Milestone

Comments

@openradar-mirror
Copy link

Description

The 'public func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool' method when implemented in a class that conforms UITableViewDelegate gets sometimes called by the system with nil for the 'indexPath' parameter.

As the indexPath parameter is bridged from Objective-C as implicitly unwrapped, this causes a crash and makes the test fail with the following error:

Assertion Failure: UI Testing Failure - Failure getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 "Error -25204 getting snapshot for element AXUIElement 0x7f84b5c0ea40 {pid=32894}" UserInfo={NSLocalizedDescription=Error -25204 getting snapshot for element AXUIElement 0x7f84b5c0ea40 {pid=32894}}

App's backtrace on crash:

(lldb) thread backtrace

Additional notes:
Interestingly, on iOS 9 simulator this works just fine, no crashes. It's the iOS 10 and above that's problematic

Expected results:
This problematic UITableViewDelegate's method should either not be called at all with indexPath=nil or the indexPath type should be marked as optional:

'public func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath?, withSender sender: Any?) -> Bool'

Product Version: 10.0
Created: 2017-03-31T18:49:26.449740
Originated: 2017-03-31T00:00:00
Open Radar Link: http://www.openradar.me/31375101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant