Ejemplo n.º 1
0
  /**
   * 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());
    }
  }
Ejemplo n.º 2
0
 private Integer countLeafStepsIn(List<TestStep> testSteps) {
   int leafCount = 0;
   for (TestStep step : testSteps) {
     if (step.isAGroup()) {
       leafCount += countLeafStepsIn(step.getChildren());
     } else {
       leafCount++;
     }
   }
   return leafCount;
 }