getBehaviorDrivenDescription method

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

Gets the most appropriate BDD string based on the values set on the step.

Implementation

@override
String getBehaviorDrivenDescription(TestController tester) {
  String result;

  if (imageId == null && goldenCompatible == false) {
    result = behaviorDrivenDescriptions[0];
  } else if (imageId != null && goldenCompatible == false) {
    result = behaviorDrivenDescriptions[1];
  } else if (imageId == null && goldenCompatible == true) {
    result = behaviorDrivenDescriptions[2];
  } else {
    result = behaviorDrivenDescriptions[3];
  }

  result = result.replaceAll('{{imageId}}', imageId ?? 'null');
  result = result.replaceAll(
    '{{goldenCompatible}}',
    goldenCompatible == true ? 'golden' : 'not golden',
  );

  return result;
}