Skip to content

Broken tests with Xcode 16-RC / iOS 18 #1303

@jdev7

Description

@jdev7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions