use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetForWhenAnd.
private String snippetForWhenAnd(String stepText) {
String source = "" + "Feature: Test feature\n" + " Scenario: Test Scenario\n" + " When some other step\n" + " And " + stepText + "\n";
Feature feature = TestFeatureParser.parse(source);
Step step = feature.getPickles().get(0).getSteps().get(1);
List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
return String.join("\n", snippet);
}
use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetFor.
private String snippetFor(String stepText, ParameterType<?> parameterType) {
Step step = createStep(stepText);
ParameterTypeRegistry parameterTypeRegistry = new ParameterTypeRegistry(Locale.ENGLISH);
parameterTypeRegistry.defineParameterType(parameterType);
List<String> snippet = new SnippetGenerator(new JavaSnippet(), parameterTypeRegistry).getSnippet(step, snippetType);
return String.join("\n", snippet);
}
use of io.cucumber.cucumberexpressions.ParameterTypeRegistry in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetForWildCard.
private String snippetForWildCard(String stepText) {
String source = "" + "Feature: Test feature\n" + " Scenario: Test Scenario\n" + " * " + stepText + "\n";
Feature feature = TestFeatureParser.parse(source);
Step step = feature.getPickles().get(0).getSteps().get(0);
List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
return String.join("\n", snippet);
}
Aggregations