XCTest: add ability to scroll to an element that's off the screen
Originator: | whakkee | ||
Number: | rdar://30072874 | Date Originated: | 18-Jan-2017 |
Status: | Open | Resolved: | no |
Product: | iOS + SDK | Product Version: | 10.2 (14C92) |
Classification: | Feature (New) | Reproducible: | Always |
Summary: With the XCTest framework it currently doesn’t seem possible to simply scroll to an element that’s off the screen. It’s possible to do a number of swipeUp or swipeDowns, but that way you risk swiping over the element. The number of swipes will always be an arbitrary number. It would be good to be able to test if an element exists in a tableView or collectionView, and if so, to be able to scroll to it. Steps to Reproduce: see Summary Expected Results: see Summary Actual Results: see Summary Regression: This occurs in all iOS 10.x versions, potentially also in lower versions and/or on macOS Notes: A workaround is to create a loop, and keep swiping up or down until the element is found, but tbh, I think it would be better if this was part of the XCTest framework An example of a workaround can be found here: http://averagepro.com/2016/02/12/more-xctest-ut-testing-a-helper-function-to-scroll-to-a-cell-in-a-uicollectionview/
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!