getBehaviorDrivenDescription method
Gets the most appropriate BDD string based on the values set on the step.
Implementation
@override
String getBehaviorDrivenDescription(TestController tester) {
String result;
var setDx = dx != null && JsonClass.parseDouble(dx) != 0.0;
var setDy = dy != null && JsonClass.parseDouble(dy) != 0.0;
if (timeout == null) {
if (setDx && setDy) {
result = behaviorDrivenDescriptions[2];
} else if (setDx) {
result = behaviorDrivenDescriptions[0];
} else {
result = behaviorDrivenDescriptions[1];
}
} else {
if (setDx && setDy) {
result = behaviorDrivenDescriptions[5];
} else if (setDx) {
result = behaviorDrivenDescriptions[3];
} else {
result = behaviorDrivenDescriptions[4];
}
result = result.replaceAll(
'{{timeout}}',
timeout!.inSeconds.toString(),
);
}
result = result.replaceAll('{{dx}}', dx ?? 'null');
result = result.replaceAll('{{dy}}', dy ?? 'null');
result = result.replaceAll('{{testableId}}', testableId);
return result;
}