Search in sources :

Example 26 with TestCaseFinished

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

the class TestCaseResultObserverTest method should_not_be_skipped_for_pending_result.

@Test
public void should_not_be_skipped_for_pending_result() {
    TestCaseResultObserver resultListener = TestCaseResultObserver.observe(bus);
    TestPendingException error = new TestPendingException();
    Result stepResult = new Result(PENDING, ZERO, error);
    bus.send(new TestStepFinished(now(), testCase, step, stepResult));
    Result testCaseResult = new Result(PENDING, ZERO, error);
    bus.send(new TestCaseFinished(now(), testCase, testCaseResult));
    Exception exception = expectThrows(Exception.class, resultListener::assertTestCasePassed);
    assertEquals(exception.getCause(), error);
}
Also used : TestCaseFinished(io.cucumber.plugin.event.TestCaseFinished) TestStepFinished(io.cucumber.plugin.event.TestStepFinished) SkipException(org.testng.SkipException) Result(io.cucumber.plugin.event.Result) Test(org.testng.annotations.Test)

Aggregations

TestCaseFinished (io.cucumber.plugin.event.TestCaseFinished)26 Result (io.cucumber.plugin.event.Result)25 TestStepFinished (io.cucumber.plugin.event.TestStepFinished)22 Test (org.junit.jupiter.api.Test)16 TestCaseStarted (io.cucumber.plugin.event.TestCaseStarted)15 TestStepStarted (io.cucumber.plugin.event.TestStepStarted)14 Test (org.testng.annotations.Test)9 Failure (org.junit.runner.notification.Failure)7 SkipException (org.testng.SkipException)7 CucumberException (io.cucumber.core.exception.CucumberException)4 SnippetsSuggestedEvent (io.cucumber.plugin.event.SnippetsSuggestedEvent)4 Suggestion (io.cucumber.plugin.event.SnippetsSuggestedEvent.Suggestion)4 AssumptionViolatedException (org.junit.AssumptionViolatedException)4 TestAbortedException (org.opentest4j.TestAbortedException)4 MultipleFailureException (org.junit.runners.model.MultipleFailureException)3 EventBus (io.cucumber.core.eventbus.EventBus)2 UUID (java.util.UUID)2 RuntimeOptions (io.cucumber.core.options.RuntimeOptions)1 RuntimeOptionsBuilder (io.cucumber.core.options.RuntimeOptionsBuilder)1 TimeServiceEventBus (io.cucumber.core.runtime.TimeServiceEventBus)1