예제 #1
0
 public SELF the_scenario_has_$_default_cases(int ncases) {
   reportModel.getLastScenarioModel().clearCases();
   for (int i = 0; i < ncases; i++) {
     addDefaultCase(reportModel.getLastScenarioModel());
   }
   return self();
 }
예제 #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();
 }
예제 #3
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);
  }
예제 #4
0
 public SELF the_report_has_$_scenarios(int n) {
   reportModel.getScenarios().clear();
   for (int i = 0; i < n; i++) {
     createScenarioModel("something should happen " + i, "something_should_happen_" + i);
   }
   return self();
 }
예제 #5
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();
 }
예제 #6
0
 public SELF case_$_has_no_steps(int caseNr) {
   reportModel
       .getLastScenarioModel()
       .getCase(caseNr - 1)
       .setSteps(Collections.<StepModel>emptyList());
   return self();
 }
예제 #7
0
 public SELF all_cases_have_a_step_$_with_argument(String name, String arg) {
   int i = 1;
   for (ScenarioCaseModel caseModel : reportModel.getLastScenarioModel().getScenarioCases()) {
     case_$_has_a_step_$_with_argument(i++, name, arg);
   }
   return self();
 }
예제 #8
0
  public SELF a_report_model() {
    reportModel = new ReportModel();
    reportModel.setClassName("Test Class");

    createScenarioModel("something should happen", "something_should_happen");

    return self();
  }
예제 #9
0
 private StepModel getStep(int stepNr, int scenarioNr, int caseNr) {
   return reportModel
       .getScenarios()
       .get(scenarioNr - 1)
       .getScenarioCases()
       .get(caseNr - 1)
       .getStep(stepNr - 1);
 }
예제 #10
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();
 }
예제 #11
0
 public ReportStatistics getStatistics(ReportModel model) {
   ReportStatistics result = new ReportStatistics();
   model.accept(new StatisticsVisitor(result));
   return result;
 }
예제 #12
0
 public SELF scenario_$_has_tag_$_with_value_$(int i, String name, String value) {
   latestTag = new Tag(name, value).setPrependType(true);
   reportModel.getScenarios().get(i - 1).addTag(latestTag);
   reportModel.addTag(latestTag);
   return self();
 }
예제 #13
0
 private ScenarioCaseModel getCase(int ncase) {
   return reportModel.getLastScenarioModel().getScenarioCases().get(ncase - 1);
 }
예제 #14
0
 private ScenarioCaseModel getCase(int scenarioNr, int caseNr) {
   return reportModel.getScenarios().get(scenarioNr - 1).getCase(caseNr - 1);
 }
예제 #15
0
 public SELF the_scenario_has_a_duration_of_$_nano_seconds(long durationInNanos) {
   reportModel.getLastScenarioModel().setDurationInNanos(durationInNanos);
   return self();
 }
예제 #16
0
 public SELF the_scenario_has_parameters(String... params) {
   reportModel.getLastScenarioModel().addParameterNames(params);
   return self();
 }