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 = imageId == null
      ? behaviorDrivenDescriptions[0]
      : behaviorDrivenDescriptions[1];

  result = result.replaceAll('{{allowedDelta}}',
      allowedDelta == null ? '0' : allowedDelta!.toString());
  result = result.replaceAll('{{imageId}}', imageId ?? 'null');
  result = result.replaceAll(
    '{{failWhenGoldenMissing}}',
    failWhenGoldenMissing == true ? 'fail' : 'not fail',
  );
  result =
      result.replaceAll('{{aAn}}', imageOnFail == 'isolated' ? 'an' : 'a');
  result = result.replaceAll(
      '{{imageOnFail}}', imageOnFail == 'isolated' ? 'isolated' : 'masked');

  return result;
}