kif-framework / KIF

Keep It Functional - An iOS Functional Testing Framework
Other
6.2k stars 909 forks source link

Revert "Merge pull request #1246 from kif-framework/derko/mimic-table… #1252

Closed dostrander closed 2 years ago

dostrander commented 2 years ago

…view-element-matching"

This reverts commit aa8d173f698c35c640b558f855c44d5cd9395f59, reversing changes made to 252b34ecb40987e7476a2aaaead7a73099de4d9b.

Why Collectionview's render different than tableview's. A cell isn't able to be rendered unless the main runloop runs and it is supposed to be on screen. This forces us to run the runloop and actually scroll the view within the forloop of looking for the element in the scrollview. This causes un-intended side effects because users of this might change the UI based on if the collectionview scrolls which can cause bugs and flakiness depending on the ordering of searching the view hierarchy. For example if you have a label and a collectionview in a view and KIF searches the view heirarchy, finding the collectionview first it will scroll and MAY change what the label says, which isn't exactly what we want.

Overall i think we can re-introduce this if we make 2 somewhat large changes to KIF. First change the priority of what get's searched first. Namely we deprioritize searching scrollview's until the end. This may require us to change the implementation of searching to not be recursive. Second we introduce an API to enforce that we do not scroll any scrollview's on screen.