use of io.cucumber.messages.types.Step in project cucumber-jvm by cucumber.
the class JsonFormatter method createTestStep.
private Map<String, Object> createTestStep(PickleStepTestStep testStep) {
Map<String, Object> stepMap = new HashMap<>();
stepMap.put("name", testStep.getStepText());
stepMap.put("line", testStep.getStepLine());
TestSourcesModel.AstNode astNode = testSources.getAstNode(currentFeatureFile, testStep.getStepLine());
StepArgument argument = testStep.getStepArgument();
if (argument != null) {
if (argument instanceof DocStringArgument) {
DocStringArgument docStringArgument = (DocStringArgument) argument;
stepMap.put("doc_string", createDocStringMap(docStringArgument));
} else if (argument instanceof DataTableArgument) {
DataTableArgument dataTableArgument = (DataTableArgument) argument;
stepMap.put("rows", createDataTableList(dataTableArgument));
}
}
if (astNode != null) {
Step step = (Step) astNode.node;
stepMap.put("keyword", step.getKeyword());
}
return stepMap;
}
use of io.cucumber.messages.types.Step in project cucumber-jvm by cucumber.
the class TestSourcesModel method processBackgroundDefinition.
private void processBackgroundDefinition(Map<Long, AstNode> nodeMap, Background background, AstNode currentParent) {
AstNode childNode = new AstNode(background, currentParent);
nodeMap.put(background.getLocation().getLine(), childNode);
for (Step step : background.getSteps()) {
nodeMap.put(step.getLocation().getLine(), new AstNode(step, childNode));
}
}
use of io.cucumber.messages.types.Step in project cucumber-jvm by cucumber.
the class TestSourcesModel method processScenarioDefinition.
private void processScenarioDefinition(Map<Long, AstNode> nodeMap, Scenario child, AstNode currentParent) {
AstNode childNode = new AstNode(child, currentParent);
nodeMap.put(child.getLocation().getLine(), childNode);
for (io.cucumber.messages.types.Step step : child.getSteps()) {
nodeMap.put(step.getLocation().getLine(), new AstNode(step, childNode));
}
if (!child.getExamples().isEmpty()) {
processScenarioOutlineExamples(nodeMap, child, childNode);
}
}
use of io.cucumber.messages.types.Step in project cucumber-jvm by cucumber.
the class CucumberQuery method updateStep.
private void updateStep(List<Step> stepsList) {
for (Step step : stepsList) {
locationBySourceId.put(requireNonNull(step.getId()), step.getLocation());
gherkinStepById.put(requireNonNull(step.getId()), step);
}
}
Aggregations