captureStepArtifacts method

Future<bool> captureStepArtifacts({
  1. required TestStepExecutor executor,
  2. required TestStep step,
  3. required int stepIndex,
  4. required StepScreenshotOptions options,
  5. TestStep? labelStep,
  6. Future<bool> captureScreenshot()?,
})

Screenshot + Observer as one pair. Skipped shots never write Observer.

Implementation

Future<bool> captureStepArtifacts({
  required TestStepExecutor executor,
  required TestStep step,
  required int stepIndex,
  required StepScreenshotOptions options,
  TestStep? labelStep,
  Future<bool> Function()? captureScreenshot,
}) {
  return captureStepReportArtifacts(
    enabled: executor.context.config.screenshots.shouldCaptureStep(step.type),
    captureScreenshot: captureScreenshot ??
        () => captureAutomaticScreenshotForStepBestEffort(
              executor: executor,
              step: step,
              stepIndex: stepIndex,
              labelStep: labelStep,
              pumpBeforeCapture: options.pumpBeforeCapture,
              ensureTargetVisible: options.ensureTargetVisible,
              waitForTarget: options.waitForTarget,
              waitForLottie: options.waitForLottie,
              stabilize: options.stabilize,
              forFailure: options.forFailure,
              observationDetail: options.observationDetail,
              requireVisibleActionHighlight:
                  options.requireVisibleActionHighlight,
            ),
  );
}