use of gherkin.formatter.model.Result in project cucumber-jvm by cucumber.
the class ScenarioResultTest method passed_pending_undefined_skipped_is_pending.
@Test
public void passed_pending_undefined_skipped_is_pending() throws Exception {
s.add(new Result("passed", 0L, null, null));
s.add(new Result("undefined", 0L, null, null));
s.add(new Result("pending", 0L, null, null));
s.add(new Result("skipped", 0L, null, null));
assertEquals("undefined", s.getStatus());
}
use of gherkin.formatter.model.Result in project cucumber-jvm by cucumber.
the class StatsTest method should_use_locale_for_decimal_separator.
@Test
public void should_use_locale_for_decimal_separator() {
Stats counter = new Stats(true, Locale.GERMANY);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
counter.addStep(new Result(Result.PASSED, Stats.ONE_MINUTE, null));
counter.addStep(new Result(Result.PASSED, Stats.ONE_SECOND, null));
counter.addStep(new Result(Result.PASSED, ONE_MILLI_SECOND, null));
counter.printStats(new PrintStream(baos), isStrict(false));
assertThat(baos.toString(), endsWith(String.format("1m1,001s%n")));
}
use of gherkin.formatter.model.Result in project cucumber-jvm by cucumber.
the class StatsTest method should_only_print_sub_counts_if_not_zero.
@Test
public void should_only_print_sub_counts_if_not_zero() {
Stats counter = createMonochromeSummaryCounter();
Result passedResult = createResultWithStatus(Result.PASSED);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
counter.addStep(passedResult);
counter.addStep(passedResult);
counter.addStep(passedResult);
counter.addScenario(Result.PASSED);
counter.printStats(new PrintStream(baos), isStrict(false));
assertThat(baos.toString(), startsWith(String.format("1 Scenarios (1 passed)%n" + "3 Steps (3 passed)%n")));
}
use of gherkin.formatter.model.Result in project cucumber-jvm by cucumber.
the class StatsTest method should_include_hook_time_and_step_time_has_executed.
@Test
public void should_include_hook_time_and_step_time_has_executed() {
Stats counter = createMonochromeSummaryCounter();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
counter.addHookTime(ONE_MILLI_SECOND);
counter.addStep(new Result(Result.PASSED, ONE_MILLI_SECOND, null));
counter.addStep(new Result(Result.PASSED, ONE_MILLI_SECOND, null));
counter.addHookTime(ONE_MILLI_SECOND);
counter.printStats(new PrintStream(baos), isStrict(false));
assertThat(baos.toString(), endsWith(String.format("0m0.004s%n")));
}
use of gherkin.formatter.model.Result in project cucumber-jvm by cucumber.
the class StatsTest method should_print_minutes_instead_of_hours.
@Test
public void should_print_minutes_instead_of_hours() {
Stats counter = createMonochromeSummaryCounter();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
counter.addStep(new Result(Result.PASSED, ONE_HOUR, null));
counter.addStep(new Result(Result.PASSED, Stats.ONE_MINUTE, null));
counter.printStats(new PrintStream(baos), isStrict(false));
assertThat(baos.toString(), endsWith(String.format("61m0.000s%n")));
}
Aggregations