use of io.cucumber.core.snippets.SnippetGenerator in project cucumber-jvm by cucumber.
the class Runner method generateSnippetsForStep.
private List<String> generateSnippetsForStep(Step step) {
List<String> snippets = new ArrayList<>();
for (SnippetGenerator snippetGenerator : snippetGenerators) {
List<String> snippet = snippetGenerator.getSnippet(step, runnerOptions.getSnippetType());
snippets.addAll(snippet);
}
return snippets;
}
use of io.cucumber.core.snippets.SnippetGenerator in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetForDocString.
private String snippetForDocString(String stepText, String docString, ParameterType<String> parameterType) {
Step step = createStepWithDocString(stepText, docString);
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.core.snippets.SnippetGenerator in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetForDataTable.
private String snippetForDataTable(String stepText, ParameterType<String> parameterType) {
Step step = createStepWithDataTable(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.core.snippets.SnippetGenerator in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetFor.
private String snippetFor(String stepText) {
Step step = createStep(stepText);
List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
return String.join("\n", snippet);
}
use of io.cucumber.core.snippets.SnippetGenerator in project cucumber-jvm by cucumber.
the class JavaSnippetTest method snippetForDocString.
private String snippetForDocString(String stepText, String docString) {
Step step = createStepWithDocString(stepText, docString);
List<String> snippet = new SnippetGenerator(new JavaSnippet(), new ParameterTypeRegistry(Locale.ENGLISH)).getSnippet(step, snippetType);
return String.join("\n", snippet);
}
Aggregations