Exemplo n.º 1
0
 public SELF scenario_$_has_no_steps(int i) {
   ScenarioModel scenarioModel = reportModel.getLastScenarioModel();
   for (ScenarioCaseModel caseModel : scenarioModel.getScenarioCases()) {
     caseModel.setSteps(Collections.<StepModel>emptyList());
   }
   return self();
 }
Exemplo n.º 2
0
 public SELF a_report_model_with_name(String name) {
   a_report_model();
   reportModel.setClassName(name);
   for (ScenarioModel model : reportModel.getScenarios()) {
     model.setClassName(name);
   }
   return self();
 }
Exemplo n.º 3
0
 public SELF the_scenario_has_$_cases(int ncases) {
   ScenarioModel scenarioModel = reportModel.getLastScenarioModel();
   scenarioModel.clearCases();
   for (int i = 0; i < ncases; i++) {
     scenarioModel.addCase(new ScenarioCaseModel());
   }
   return self();
 }
Exemplo n.º 4
0
  private void createScenarioModel(String description, String testMethodName) {
    ScenarioModel scenarioModel = new ScenarioModel();
    scenarioModel.setClassName(reportModel.getClassName());
    scenarioModel.setDescription(description);
    scenarioModel.setTestMethodName(testMethodName);

    addDefaultCase(scenarioModel);

    reportModel.getScenarios().add(scenarioModel);
  }
Exemplo n.º 5
0
  private void addDefaultCase(ScenarioModel scenarioModel) {
    ScenarioCaseModel scenarioCaseModel = new ScenarioCaseModel();
    scenarioModel.addCase(scenarioCaseModel);
    int i = 0;
    for (String param : scenarioModel.getExplicitParameters()) {
      scenarioCaseModel.addExplicitArguments("arg" + scenarioCaseModel.getCaseNr() + i++);
    }

    scenarioCaseModel.addStep(
        new StepModel(
            "something_happens", Arrays.asList(Word.introWord("given"), new Word("something"))));
    i = 0;
    for (String arg : scenarioCaseModel.getExplicitArguments()) {
      String argumentName = "stepArg" + i++;
      scenarioCaseModel.addStep(
          new StepModel(
              "something_happens",
              asList(Word.introWord("when"), Word.argWord(argumentName, arg, (String) null))));
    }
  }