strSummary method

String strSummary()

strSummary returns a printable summary of the event.

Implementation

String strSummary() {
  String ret = (waitDuration?.toString() ?? "");
  ret += " ${type.name}";
  switch (type) {
    case FlutsterTestEventType.tap:
      ret += "; ${tapSummaryStr()}";
      break;
    case FlutsterTestEventType.key:
      ret += "; ${typedText ?? ""}";
      break;
    case FlutsterTestEventType.screenShot:
      String fnName = screenShotComparisonFunctionName ??
          defaultScreenshotComparisonFunctionName;
      ret +=
          "; function: $fnName; acceptance pct: $screenShotAcceptancePctThreshold";
      if (fnName == "Pixel - Matching") {
        ret +=
            "; pixel matching tolerance: $screenShotAcceptancePctThreshold";
      }
      if (fnName == "Pixel - IMED") {
        ret += "; iMED sigma: $iMEDSigma; iMED blur ratio: $iMEDBlurRatio";
      }
      ret += "; match result: ${screenShotMatchResult?.toString() ?? "none"}";
      ret += "; screenShotB42: ${screenShotToB64()}";
      break;
    default:
      ret += "; unknown event type for summary";
      break;
  }
  return (ret);
}