hostReport function

EnsembleTestReportDetails hostReport(
  1. EnsembleTestCase test,
  2. ApplicationTestServices? services, {
  3. List<int> stepDurationsMs = const [],
  4. List<String> stepStartTimes = const [],
  5. Map<String, Map<String, dynamic>> screens = const {},
})

Implementation

EnsembleTestReportDetails hostReport(
  EnsembleTestCase test,
  ApplicationTestServices? services, {
  List<int> stepDurationsMs = const [],
  List<String> stepStartTimes = const [],
  Map<String, Map<String, dynamic>> screens = const {},
}) {
  final navigation = services?.navigation;
  final history = navigation?.routeHistory ?? const <String>[];
  return EnsembleTestReportDetails(
    startScreen: history.isEmpty ? null : history.first,
    endScreen: navigation?.currentRoute,
    navigationKnown: navigation != null,
    session: test.session,
    screensVisited: history,
    stepsOutline: outlineSteps(test.steps),
    stepDurationsMs: stepDurationsMs,
    stepStartTimes: stepStartTimes,
    screens: {
      for (final entry in screens.entries)
        entry.key: Map<String, dynamic>.from(entry.value),
    },
  );
}