getBehaviorDrivenDescription method

  1. @override
String getBehaviorDrivenDescription(
  1. TestController tester
)

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 (timeout != null) {
    result = behaviorDrivenDescriptions[1];
    result = result.replaceAll('{{timeout}}', timeout!.inSeconds.toString());
  }

  result = result.replaceAll(
    '{{backgroundColor}}',
    backgroundColor == null
        ? 'transparent'
        : '#${backgroundColor!.value.toRadixString(16).padLeft(8, '0')}',
  );
  result = result.replaceAll(
    '{{goldenCompatible}}',
    (goldenCompatible ?? true).toString(),
  );
  result = result.replaceAll(
    '{{imageId}}',
    imageId == null ? 'widget_$testableId' : imageId!,
  );
  result = result.replaceAll('{{testableId}}', testableId);

  return result;
}