Snapshots of scroll view on different scroll positions
We have some snapshot-tests that deal with having a scroll view and based on some logic it scrolls to a particular offset and a snapshot is then taken.
This works well locally But fails every time on CI.
This issue has been bothering me for a while now. Is there a possible way to fix this? Just pointers to help:
- Animation is already Off
- no async operation is being done
Psuedo Code:
func doScreenshot() {
setupcomponent
collectionNode.scrollToItem(at indexpath...)
assert(view, .image)
}
I have a similar issue when I want to snapshot the bottom of a view with
tableView.setContentOffset(CGPoint(x:0, y:CGFloat.greatestFiniteMagnitude), animated: false) it does not scroll to the bottom, but 2 or 3 cells above the bottom.
Maybe just use the size param in .image and stretch the vc to be longer than the scrollView so you can take a snapshot for the entire thing?
This is somewhat related to #173 and #383. Ideally we have more "hooks" into view/VC strategies in the future.