runActivityNamed:block:
Creates and runs an activity with the provided block of code.
Declaration
+ (void) runActivityNamed:(NSString *) name block:(void (^)(id<XCTActivity> activity)) block;Parameters
- name:
A descriptive name for the activity, for display in Xcode’s test results browser.
- block:
A block of code for the test to execute as the body of the activity.
Mentioned in
Discussion
Run a block of code as a named substep in a test. For more information, see Grouping Tests into Substeps with Activities.
To save screenshots or other test-result data for later investigation, call the add(_:) method on the instance of XCTActivity that the test system passes to your block. For more information, see Adding Attachments to Tests, Activities, and Issues.