Missing required module 'Testing'

Recently i saw an error in the Xcode 16, when ever i try to build the app for testing it is throwing this error missing required module 'Testing'.
Everything was working fine in Xcode 15 but now my UI tests are not compiling at all.

I have the same problem an no clue yet :frowning:

I have the same problem. I noticed one of external dependency swift-snapshot-testing use framework Testing. I have swift-snapshot-testing in local package AppTestUtils. Target AppUITests use AppTestUtils in «Build phases» -> «Link binary with libraries» and was imported in several files. I remove all import AppTestUtils from files for UI tests and it worked. It's strange, but it's not necessary to remove AppTestUtils package from the AppTestUtils target, remove imports is enough.

1 Like

I have found now found the problem. I have some test helper classes in a framework. This framework had also helpers to swift testing. This framework was also included in the UITests. After moving the swift testing related helpers to its own framework, that is only uses by swift testing tests and not UITests solved this problem.

Currently UI tests and Swift Testing are completely incompatible. You cannot even import Testing into a UI test target. This means you also can't import any library that uses Swift Testing either.

So, if you are using something like swift-snapshot-testing, which does provide snapshot helpers that work with Swift Testing, then you cannot import SnapshotTesting into a UI test target.

1 Like