added StepStartedMessage with table data, for reporters to use.
This commit is contained in:
parent
6e82b95d09
commit
1dd9bd856d
|
@ -136,7 +136,7 @@ class FeatureFileRunner {
|
|||
await _log(
|
||||
"Attempting to run step '${step.name}'", step.debug, MessageLevel.info);
|
||||
await _reporter
|
||||
.onStepStarted(StartedMessage(Target.step, step.name, step.debug));
|
||||
.onStepStarted(StepStartedMessage(Target.step, step.name, step.debug, step.table));
|
||||
if (skipExecution) {
|
||||
result = StepResult(0, StepExecutionResult.skipped);
|
||||
} else {
|
||||
|
|
|
@ -43,7 +43,7 @@ class AggregatedReporter extends Reporter {
|
|||
}
|
||||
|
||||
@override
|
||||
Future<void> onStepStarted(StartedMessage message) async {
|
||||
Future<void> onStepStarted(StepStartedMessage message) async {
|
||||
await _invokeReporters((r) async => await r.onStepStarted(message));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:flutter_gherkin/src/gherkin/models/table.dart';
|
||||
import 'package:flutter_gherkin/src/gherkin/runnables/debug_information.dart';
|
||||
import 'package:flutter_gherkin/src/gherkin/steps/step_run_result.dart';
|
||||
|
||||
|
@ -19,6 +20,14 @@ class FinishedMessage {
|
|||
FinishedMessage(this.target, this.name, this.context);
|
||||
}
|
||||
|
||||
class StepStartedMessage extends StartedMessage {
|
||||
final Table table;
|
||||
|
||||
StepStartedMessage(
|
||||
Target target, String name, RunnableDebugInformation context, this.table)
|
||||
: super(target, name, context);
|
||||
}
|
||||
|
||||
class StepFinishedMessage extends FinishedMessage {
|
||||
final StepResult result;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ abstract class Reporter {
|
|||
Future<void> onFeatureFinished(FinishedMessage message) async {}
|
||||
Future<void> onScenarioStarted(StartedMessage message) async {}
|
||||
Future<void> onScenarioFinished(ScenarioFinishedMessage message) async {}
|
||||
Future<void> onStepStarted(StartedMessage message) async {}
|
||||
Future<void> onStepStarted(StepStartedMessage message) async {}
|
||||
Future<void> onStepFinished(StepFinishedMessage message) async {}
|
||||
Future<void> onException(Exception exception, StackTrace stackTrace) async {}
|
||||
Future<void> message(String message, MessageLevel level) async {}
|
||||
|
|
Loading…
Reference in New Issue