Activities and Attachments

Split long tests into substeps with activities. Attach output data such as files and screenshots to tests and activities.



Grouping Tests into Substeps with Activities

Create named activities within test methods to simplify test reports.

class XCTContext

A proxy for the current testing context.

protocol XCTActivity

A named substep of a test method.



Adding Attachments to Tests and Activities

Use attachments to store a test's output data for later analysis.

class XCTAttachment

Data from a test method's execution, such as a file, image, screenshot, data blob, or zip archive.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software