Search in sources :

Example 36 with Result

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

the class ResultTest method passed_result_is_ok.

@Test
void passed_result_is_ok() {
    Result passedResult = new Result(PASSED, ZERO, null);
    assertTrue(passedResult.getStatus().isOk());
}
Also used : Result(io.cucumber.plugin.event.Result) Test(org.junit.jupiter.api.Test)

Example 37 with Result

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

the class TestCaseStateResultTest method failed_followed_by_pending_yields_failed_error.

@Test
void failed_followed_by_pending_yields_failed_error() {
    Throwable failedError = mock(Throwable.class);
    Throwable pendingError = mock(Throwable.class);
    s.add(new Result(Status.FAILED, ZERO, failedError));
    s.add(new Result(Status.PENDING, ZERO, pendingError));
    assertThat(s.getError(), sameInstance(failedError));
}
Also used : Result(io.cucumber.plugin.event.Result) Test(org.junit.jupiter.api.Test)

Example 38 with Result

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

the class TestCaseStateResultTest method passed_failed_pending_undefined_skipped_is_failed.

@Test
void passed_failed_pending_undefined_skipped_is_failed() {
    s.add(new Result(Status.PASSED, ZERO, null));
    s.add(new Result(Status.FAILED, ZERO, null));
    s.add(new Result(Status.PENDING, ZERO, null));
    s.add(new Result(Status.UNDEFINED, ZERO, null));
    s.add(new Result(Status.SKIPPED, ZERO, null));
    assertAll(() -> assertThat(s.getStatus(), is(equalTo(FAILED))), () -> assertTrue(s.isFailed()));
}
Also used : Result(io.cucumber.plugin.event.Result) Test(org.junit.jupiter.api.Test)

Example 39 with Result

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

the class TestCaseStateResultTest method passed_pending_undefined_skipped_is_pending.

@Test
void passed_pending_undefined_skipped_is_pending() {
    s.add(new Result(Status.PASSED, ZERO, null));
    s.add(new Result(Status.UNDEFINED, ZERO, null));
    s.add(new Result(Status.PENDING, ZERO, null));
    s.add(new Result(Status.SKIPPED, ZERO, null));
    assertAll(() -> assertThat(s.getStatus(), is(equalTo(UNDEFINED))), () -> assertFalse(s.isFailed()));
}
Also used : Result(io.cucumber.plugin.event.Result) Test(org.junit.jupiter.api.Test)

Example 40 with Result

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

the class TestCaseStateResultTest method pending_followed_by_failed_yields_failed_error.

@Test
void pending_followed_by_failed_yields_failed_error() {
    Throwable pendingError = mock(Throwable.class);
    Throwable failedError = mock(Throwable.class);
    s.add(new Result(Status.PENDING, ZERO, pendingError));
    s.add(new Result(Status.FAILED, ZERO, failedError));
    assertThat(s.getError(), sameInstance(failedError));
}
Also used : 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