getBehaviorDrivenDescription method
Gets the most appropriate BDD string based on the values set on the step.
Implementation
@override
String getBehaviorDrivenDescription(TestController tester) {
var result = behaviorDrivenDescriptions[0];
if (counterVariableName == null && maxIterations != null) {
result = behaviorDrivenDescriptions[1];
} else if (counterVariableName != null && maxIterations == null) {
result = behaviorDrivenDescriptions[2];
} else if (counterVariableName == null && maxIterations == null) {
result = behaviorDrivenDescriptions[2];
}
TestRunnerStep? runnerStep;
try {
runnerStep = tester.registry.getRunnerStep(
id: step['id'],
values: step['values'],
);
} catch (e) {
// no-op
}
result = result.replaceAll(
'{{counterVariableName}}',
counterVariableName ?? 'null',
);
result = result.replaceAll('{{maxIterations}}', maxIterations ?? 'null');
result = result.replaceAll('{{value}}', value ?? 'null');
result = result.replaceAll('{{variableName}}', variableName);
var desc = runnerStep == null
? 'nothing.'
: runnerStep.getBehaviorDrivenDescription(tester);
result += '\n1. Then I will execute the sub-step, $desc\n';
return result;
}