Search in sources :

Example 11 with TestCase

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

the class Stats method addScenario.

private void addScenario(TestCaseFinished event) {
    TestCase testCase = event.getTestCase();
    addScenario(event.getResult().getStatus(), testCase);
}
Also used : TestCase(io.cucumber.plugin.event.TestCase)

Example 12 with TestCase

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

the class Stats method printScenarios.

private void printScenarios(PrintStream out, List<TestCase> scenarios, Status type) {
    Format format = formats.get(type.name().toLowerCase(ROOT));
    if (!scenarios.isEmpty()) {
        out.println(format.text(firstLetterCapitalizedName(type) + " scenarios:"));
    }
    for (TestCase scenario : scenarios) {
        String location = scenario.getUri() + ":" + scenario.getLocation().getLine();
        out.println(location + " # " + scenario.getName());
    }
    if (!scenarios.isEmpty()) {
        out.println();
    }
}
Also used : DecimalFormat(java.text.DecimalFormat) TestCase(io.cucumber.plugin.event.TestCase)

Example 13 with TestCase

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

the class CanonicalEventOrderTest method createTestCaseEvent.

private static TestCaseStarted createTestCaseEvent(Instant instant, URI uri, int line) {
    final TestCase testCase = mock(TestCase.class);
    given(testCase.getUri()).willReturn(uri);
    given(testCase.getLocation()).willReturn(new Location(line, -1));
    return new TestCaseStarted(instant, testCase);
}
Also used : TestCase(io.cucumber.plugin.event.TestCase) TestCaseStarted(io.cucumber.plugin.event.TestCaseStarted) Location(io.cucumber.plugin.event.Location)

Aggregations

TestCase (io.cucumber.plugin.event.TestCase)13 PickleStepTestStep (io.cucumber.plugin.event.PickleStepTestStep)5 Location (io.cucumber.plugin.event.Location)3 TestCaseStarted (io.cucumber.plugin.event.TestCaseStarted)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 EventBus (io.cucumber.core.eventbus.EventBus)2 TimeServiceEventBus (io.cucumber.core.runtime.TimeServiceEventBus)2 EventPublisher (io.cucumber.plugin.event.EventPublisher)2 Node (io.cucumber.plugin.event.Node)2 Result (io.cucumber.plugin.event.Result)2 TestCaseFinished (io.cucumber.plugin.event.TestCaseFinished)2 TestRunFinished (io.cucumber.plugin.event.TestRunFinished)2 TestSourceParsed (io.cucumber.plugin.event.TestSourceParsed)2 TestStepFinished (io.cucumber.plugin.event.TestStepFinished)2 TestStepStarted (io.cucumber.plugin.event.TestStepStarted)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 CucumberException (io.cucumber.core.exception.CucumberException)1