file method

File file(
  1. String path
)

Turns a step's artifact path — ScenarioRunStep.image, its tree, its events — into a file. Worktree-relative paths resolve against root; a run sent outside the worktree with --output records absolute paths, which pass through.

Implementation

File file(String path) {
  var native = path.replaceAll('/', Platform.pathSeparator);
  return File(
    File(native).isAbsolute
        ? native
        : '$root${Platform.pathSeparator}$native',
  );
}