Activities and Attachments

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

Topics

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.

Beta
protocol XCTActivity

A named substep of a test method.

Beta

Attachments

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

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