本文整理汇总了Java中gherkin.formatter.model.Step.getRows方法的典型用法代码示例。如果您正苦于以下问题:Java Step.getRows方法的具体用法?Java Step.getRows怎么用?Java Step.getRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gherkin.formatter.model.Step
的用法示例。
在下文中一共展示了Step.getRows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStepText
import gherkin.formatter.model.Step; //导入方法依赖的package包/类
private static String getStepText(Step step, ScenarioWrapper scenario) {
StringBuilder sb = new StringBuilder();
sb.append(step.getKeyword());
sb.append(step.getName());
DocString docString = step.getDocString();
if (docString != null) {
sb.append("\n\"\"\"\n");
sb.append(docString.getValue());
sb.append("\n\"\"\"");
}
if (step.getRows() != null) {
String text = scenario.getFeature().joinLines(step.getLine(), step.getLineRange().getLast() + 1);
sb.append('\n').append(text);
}
return sb.toString();
}
示例2: stepHtml
import gherkin.formatter.model.Step; //导入方法依赖的package包/类
private void stepHtml(ReportStep reportStep, Node parent) {
Step step = reportStep.getStep();
Result result = reportStep.getResult();
String extraClass = "";
if ("failed".equals(result.getStatus())) {
extraClass = " failed";
} else if ("skipped".equals(result.getStatus())) {
extraClass = " skipped";
}
Node stepRow = div("step-row",
div("step-cell" + extraClass, step.getKeyword() + step.getName()),
div("time-cell" + extraClass, getDuration(result)));
parent.appendChild(stepRow);
if (step.getRows() != null) {
Node table = node("table", null);
parent.appendChild(table);
for (DataTableRow row : step.getRows()) {
Node tr = node("tr", null);
table.appendChild(tr);
for (String cell : row.getCells()) {
tr.appendChild(node("td", null, cell));
}
}
}
if (reportStep.getCalled() != null) { // this is a 'call'
for (ReportStep rs : reportStep.getCalled()) {
Node calledStepsDiv = div("scenario-steps-nested");
parent.appendChild(calledStepsDiv);
stepHtml(rs, calledStepsDiv);
}
} else if (step.getDocString() != null) { // only for non-call, else un-synced stack traces may creep in
DocString docString = step.getDocString();
parent.appendChild(node("div", "preformatted", docString.getValue()));
}
appendLog(parent, reportStep.getLog());
}
示例3: StepDTO
import gherkin.formatter.model.Step; //导入方法依赖的package包/类
public StepDTO(Step step) {
this.comments = CommentDTO.fromGherkinComments(step.getComments());
this.keyword = step.getKeyword();
this.name = step.getName();
this.line = step.getLine();
if (step.getRows() != null) {
this.rows = new ArrayList<DataTableRowDTO>();
for (DataTableRow gherkinRow : step.getRows()) {
this.rows.add(new DataTableRowDTO(gherkinRow));
}
}
if (step.getDocString() != null) {
this.docString = new DocStringDTO(step.getDocString());
}
}