captureAutomaticScreenshotForStepBestEffort method
Future<bool>
captureAutomaticScreenshotForStepBestEffort({
- required TestStepExecutor executor,
- required TestStep step,
- required int stepIndex,
- TestStep? labelStep,
- bool pumpBeforeCapture = false,
- bool ensureTargetVisible = true,
- bool waitForTarget = false,
- bool waitForLottie = true,
- bool stabilize = true,
- bool forFailure = false,
- ObservationDetailLevel observationDetail = ObservationDetailLevel.standard,
- bool requireVisibleActionHighlight = false,
Implementation
Future<bool> captureAutomaticScreenshotForStepBestEffort({
required TestStepExecutor executor,
required TestStep step,
required int stepIndex,
TestStep? labelStep,
bool pumpBeforeCapture = false,
bool ensureTargetVisible = true,
bool waitForTarget = false,
bool waitForLottie = true,
bool stabilize = true,
bool forFailure = false,
ObservationDetailLevel observationDetail = ObservationDetailLevel.standard,
bool requireVisibleActionHighlight = false,
}) async {
try {
return await _captureAutomaticScreenshotForStep(
executor: executor,
step: step,
stepIndex: stepIndex,
labelStep: labelStep,
pumpBeforeCapture: pumpBeforeCapture,
ensureTargetVisible: ensureTargetVisible,
waitForTarget: waitForTarget,
waitForLottie: waitForLottie,
stabilize: stabilize,
forFailure: forFailure,
observationDetail: observationDetail,
requireVisibleActionHighlight: requireVisibleActionHighlight,
);
} catch (error) {
// Screenshot capture must never replace the real test failure, but a
// silent drop makes a missing first-step artifact impossible to explain.
// Keep the diagnostic lightweight and in the normal per-test log so it
// is available in the report without changing the execution result.
logStandaloneScreenshotCaptureFailure(
context: executor.context,
step: step,
stepIndex: stepIndex,
error: error,
);
return false;
}
}