takeScreenshotArtifacts method

({List<ScreenshotSheetFrame> frames, List<StepObserverArtifact> stepObservers}) takeScreenshotArtifacts()

Detaches the visual report buffers for completion without disposing them. Hosted and standalone adapters share this transfer so they cannot drift on copy/clear behavior before handing frames to the report writer.

Implementation

({
  List<ScreenshotSheetFrame> frames,
  List<StepObserverArtifact> stepObservers,
}) takeScreenshotArtifacts() {
  final frames = List<ScreenshotSheetFrame>.from(screenshotSheetFrames);
  screenshotSheetFrames.clear();
  final observers = List<StepObserverArtifact>.from(stepObservers);
  stepObservers.clear();
  return (frames: frames, stepObservers: observers);
}