Skip to content

Commit 34de2f8

Browse files
committed
CucumberSupport update
1 parent 4efabf6 commit 34de2f8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Dataverse/templates/pp-test-ui/scripts/generate-mock-bindings.csx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using System.Reflection;
88
using System.Text.Json;
99
using System.Collections.Generic;
1010
using System.Text;
11+
using System.Text.RegularExpressions;
1112

1213
// CONFIG
1314
var dllPath = Args.Count > 0 ? Args[0] : throw new Exception(" DLL path not provided");
@@ -51,7 +52,13 @@ foreach (var type in assembly.GetTypes())
5152
}
5253
}
5354

54-
// GENERATE FAKE .cs FILE
55+
// GENERATE FAKE .cs FILE
56+
57+
public string ReplaceRegexGroups(string input)
58+
{
59+
return Regex.Replace(input, @"\(\.\*\)", "{string}");
60+
61+
}
5562
var sb = new StringBuilder();
5663
sb.AppendLine("using Reqnroll;");
5764
sb.AppendLine("namespace FakeBindingsForEditor");
@@ -61,7 +68,8 @@ sb.AppendLine(" {");
6168

6269
foreach (var step in steps)
6370
{
64-
sb.AppendLine($" [{step.StepType}(\"{step.Text.Replace("\"", "\\\"")}\")]");
71+
var simplifiedText = ReplaceRegexGroups(step.Text).Replace("\"", "\\\"");
72+
sb.AppendLine($" [{step.StepType}(\"{simplifiedText}\")] ");
6573
sb.AppendLine($" public void {step.Method}() {{ }}");
6674
sb.AppendLine();
6775
}

0 commit comments

Comments
 (0)