snapshotPayload function
Freezes the step tree and extras for upload (plugin tier).
Implementation
Payload snapshotPayload(TestContext? ctx) {
if (ctx == null) {
return Payload(
setup: <StepJson>[],
test: <StepJson>[],
teardown: <StepJson>[],
attachments: <Map<String, Object?>>[],
errorMessage: '',
comment: '',
);
}
return Payload(
setup: _flattenSteps(ctx._roots[StepSection.setup] ?? const []),
test: _flattenSteps(ctx._roots[StepSection.test] ?? const []),
teardown: _flattenSteps(ctx._roots[StepSection.teardown] ?? const []),
attachments: ctx._resultAttachments,
errorMessage: ctx._resultError,
comment: ctx._resultComment,
hasFailedStep: ctx._hasFailedStep,
hasStepError: ctx._hasStepError,
);
}