what is new in xctest?

Asked on 06/16/2025

2 searches

In the recent WWDC sessions, several updates and enhancements to XCTest were highlighted:

  1. UI Testing Enhancements: Xcode's UI testing has received significant upgrades, including an enhanced UI Automation Recording feature with a new code generation system. This makes it easier to implement UI tests by recording interactions and generating the corresponding test code automatically. Additionally, the Measure API in Xcode 26 now includes an XCT Hitch metric to catch hitches in your app during testing, such as scrolling animation performance. This helps in measuring the responsiveness of your UI (What’s new in Xcode).

  2. Runtime API Checks: Xcode now includes more runtime API checks in tests configured in the Test Plan Configuration Editor. This feature helps surface framework runtime issues and threading problems using the Thread Performance Checker, which detects issues like priority inversions and non-UI work on the main thread (What’s new in Xcode).

  3. Integration with Swift Testing: While Swift Testing is a new framework that offers a different approach to testing, it can coexist with XCTest. Swift Testing uses traits and a different approach to parallelization, running in process using Swift concurrency. It supports physical devices like iPhone and Apple Watch. However, for tests that use UI automation APIs like XCTest UI application or performance testing APIs like xctmetric, XCTest is still required (Meet Swift Testing).

These updates aim to streamline the testing process, improve test reliability, and enhance the overall testing experience in Xcode.