Search in sources :

Example 6 with PickleRunner

use of io.cucumber.junit.PickleRunners.PickleRunner in project cucumber-jvm by cucumber.

the class PickleRunnerWithStepDescriptionsTest method shouldUseScenarioNameForDisplayName.

@Test
void shouldUseScenarioNameForDisplayName() {
    List<Pickle> pickles = picklesFromFeature("featurePath", "" + "Feature: feature name\n" + "  Scenario: scenario name\n" + "    Then it works\n");
    PickleRunner runner = PickleRunners.withStepDescriptions(context, pickles.get(0), null, createJunitOptions());
    assertEquals("scenario name", runner.getDescription().getDisplayName());
}
Also used : PickleRunner(io.cucumber.junit.PickleRunners.PickleRunner) Pickle(io.cucumber.core.gherkin.Pickle) Test(org.junit.jupiter.api.Test)

Example 7 with PickleRunner

use of io.cucumber.junit.PickleRunners.PickleRunner in project cucumber-jvm by cucumber.

the class PickleRunnerWithNoStepDescriptionsTest method shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption.

@Test
void shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption() {
    List<Pickle> pickles = TestPickleBuilder.picklesFromFeature("featurePath", "" + "Feature: feature name\n" + "  Scenario: scenario name\n" + "    Then it works\n");
    PickleRunner runner = PickleRunners.withNoStepDescriptions("feature name", context, pickles.get(0), null, createFileNameCompatibleJUnitOptions());
    assertThat(runner.getDescription().getDisplayName(), is(equalTo("scenario_name(feature_name)")));
}
Also used : PickleRunner(io.cucumber.junit.PickleRunners.PickleRunner) Pickle(io.cucumber.core.gherkin.Pickle) Test(org.junit.jupiter.api.Test)

Aggregations

PickleRunner (io.cucumber.junit.PickleRunners.PickleRunner)7 Test (org.junit.jupiter.api.Test)7 Pickle (io.cucumber.core.gherkin.Pickle)6 Feature (io.cucumber.core.gherkin.Feature)1 TestPickleBuilder.picklesFromFeature (io.cucumber.junit.TestPickleBuilder.picklesFromFeature)1 Description (org.junit.runner.Description)1