We are experiencing failures in tests written with KIF, and we aren't sure if it's related to the framework and the new versions of Xcode & iOS, or it is a more general problem.
In our project we have both UITests running with XCUITest and KIF. However the first ones are working as they were with Xcode 15.4, but not so much when running KIF-based ones.
The most common error we're finding is the following:
KIFTestActor.m:89: Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Dequeued view: <XXXModule.XXXValuePropositionCell: 0x15fa73180; baseClass = UICollectionViewCell; frame = (383 0; 375 415); layer = <CALayer: 0x600004397bc0>>; Collection view: <UICollectionView: 0x1211e8200; frame = (0 0; 375 415); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x6000011effc0>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x6000044eb020>; contentOffset: {0, 0}; contentSize: {375, 415}; adjustedContentInset: {0, 0, 0, 0}; layout: <UICollectionViewCompositionalLayout: 0x1225a70f0>; dataSource: <XXXModule.XXXValuePropositionsCarouselView: 0x12259df10; frame = (0 140; 375 423); layer = <CALayer: 0x6000044eb120>>> (NSInternalInconsistencyException)
From our initial investigations, we have some screens in which we have a basic implementation, returning just one cell type, which is registered, while in some others we have a guard clause returning UICollectionViewTableViewCell() in the else clause, in which we have placed a breakpoint and wasn't hit while running tests and failing.
Furthermore, not running the app in a device, nor running XCUITest based tests we experience similar failures. Similarly, if I run KIF tests targeting iOS 17.x in the same Xcode 16-RC they don't fail, so the problem seems to be related to iOS 18.
Any help or guidance would be much appreciated.
We are experiencing failures in tests written with
KIF, and we aren't sure if it's related to the framework and the new versions of Xcode & iOS, or it is a more general problem.In our project we have both
UITestsrunning withXCUITestandKIF. However the first ones are working as they were withXcode 15.4, but not so much when running KIF-based ones.The most common error we're finding is the following:
From our initial investigations, we have some screens in which we have a basic implementation, returning just one cell type, which is registered, while in some others we have a guard clause returning
UICollectionViewTableViewCell()in the else clause, in which we have placed a breakpoint and wasn't hit while running tests and failing.Furthermore, not running the app in a device, nor running
XCUITestbased tests we experience similar failures. Similarly, if I runKIF teststargetingiOS 17.xin the sameXcode 16-RCthey don't fail, so the problem seems to be related to iOS 18.Any help or guidance would be much appreciated.