Search in sources :

Example 56 with Result

use of io.cucumber.plugin.event.Result in project cucumber-jvm by cucumber.

the class DefaultSummaryPrinterTest method does_not_print_duplicate_snippets.

@Test
void does_not_print_duplicate_snippets() {
    bus.send(new SnippetsSuggestedEvent(bus.getInstant(), URI.create("classpath:com/example.feature"), new Location(12, -1), new Location(13, -1), new Suggestion("", singletonList("snippet"))));
    bus.send(new SnippetsSuggestedEvent(bus.getInstant(), URI.create("classpath:com/example.feature"), new Location(12, -1), new Location(14, -1), new Suggestion("", singletonList("snippet"))));
    bus.send(new TestRunFinished(bus.getInstant(), new Result(Status.PASSED, Duration.ZERO, null)));
    assertThat(new String(out.toByteArray(), UTF_8), equalToCompressingWhiteSpace("" + "\n" + "0 Scenarios\n" + "0 Steps\n" + "0m0.000s\n" + "\n" + "\n" + "You can implement missing steps with the snippets below:\n" + "\n" + "snippet\n" + "\n" + "\n"));
}
Also used : Suggestion(io.cucumber.plugin.event.SnippetsSuggestedEvent.Suggestion) SnippetsSuggestedEvent(io.cucumber.plugin.event.SnippetsSuggestedEvent) TestRunFinished(io.cucumber.plugin.event.TestRunFinished) Location(io.cucumber.plugin.event.Location) Result(io.cucumber.plugin.event.Result) Test(org.junit.jupiter.api.Test)

Aggregations

Result (io.cucumber.plugin.event.Result)56 Test (org.junit.jupiter.api.Test)41 TestStepFinished (io.cucumber.plugin.event.TestStepFinished)29 TestCaseFinished (io.cucumber.plugin.event.TestCaseFinished)26 TestCaseStarted (io.cucumber.plugin.event.TestCaseStarted)15 TestStepStarted (io.cucumber.plugin.event.TestStepStarted)14 Test (org.testng.annotations.Test)9 UUID (java.util.UUID)7 Failure (org.junit.runner.notification.Failure)7 SkipException (org.testng.SkipException)7 PickleStepTestStep (io.cucumber.plugin.event.PickleStepTestStep)6 Status (io.cucumber.plugin.event.Status)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 List (java.util.List)6 TestAbortedException (org.opentest4j.TestAbortedException)6 EventBus (io.cucumber.core.eventbus.EventBus)5 SnippetsSuggestedEvent (io.cucumber.plugin.event.SnippetsSuggestedEvent)5 Suggestion (io.cucumber.plugin.event.SnippetsSuggestedEvent.Suggestion)5 TestRunFinished (io.cucumber.plugin.event.TestRunFinished)5 OutputStream (java.io.OutputStream)5