/** * The current step is the last step in the step list, or the last step in the children of the * current step group. */ public TestStep getCurrentStep() { checkState(!testSteps.isEmpty()); if (!inGroup()) { return lastStepIn(testSteps); } else { TestStep currentStepGroup = groupStack.peek(); return lastStepIn(currentStepGroup.getChildren()); } }
private Integer countLeafStepsIn(List<TestStep> testSteps) { int leafCount = 0; for (TestStep step : testSteps) { if (step.isAGroup()) { leafCount += countLeafStepsIn(step.getChildren()); } else { leafCount++; } } return leafCount; }