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.