Search in sources :

Example 26 with Pickle

use of io.cucumber.core.gherkin.Pickle 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)

Example 27 with Pickle

use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.

the class NamePredicateTest method anchored_name_pattern_does_not_match_part_of_name.

@Test
void anchored_name_pattern_does_not_match_part_of_name() {
    Pickle pickle = createPickleWithName("a pickle name with suffix");
    NamePredicate predicate = new NamePredicate(singletonList(Pattern.compile("^a pickle name$")));
    assertFalse(predicate.test(pickle));
}
Also used : Pickle(io.cucumber.core.gherkin.Pickle) Test(org.junit.jupiter.api.Test)

Example 28 with Pickle

use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.

the class NamePredicateTest method anchored_name_pattern_matches_exact_name.

@Test
void anchored_name_pattern_matches_exact_name() {
    Pickle pickle = createPickleWithName("a pickle name");
    NamePredicate predicate = new NamePredicate(singletonList(Pattern.compile("^a pickle name$")));
    assertTrue(predicate.test(pickle));
}
Also used : Pickle(io.cucumber.core.gherkin.Pickle) Test(org.junit.jupiter.api.Test)

Example 29 with Pickle

use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method order_type_default_none.

@Test
void order_type_default_none() {
    RuntimeOptions options = parser.parse().build();
    Pickle a = createPickle("file:path/file1.feature", "a");
    Pickle b = createPickle("file:path/file2.feature", "b");
    assertThat(options.getPickleOrder().orderPickles(Arrays.asList(a, b)), contains(a, b));
}
Also used : Pickle(io.cucumber.core.gherkin.Pickle) Test(org.junit.jupiter.api.Test)

Example 30 with Pickle

use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method ensure_order_type_reverse_is_used.

@Test
void ensure_order_type_reverse_is_used() {
    RuntimeOptions options = parser.parse("--order", "reverse").build();
    Pickle a = createPickle("file:path/file1.feature", "a");
    Pickle b = createPickle("file:path/file2.feature", "b");
    assertThat(options.getPickleOrder().orderPickles(Arrays.asList(a, b)), contains(b, a));
}
Also used : Pickle(io.cucumber.core.gherkin.Pickle) Test(org.junit.jupiter.api.Test)

Aggregations

Pickle (io.cucumber.core.gherkin.Pickle)39 Test (org.junit.jupiter.api.Test)37 PickleRunner (io.cucumber.junit.PickleRunners.PickleRunner)6 Collections.singletonList (java.util.Collections.singletonList)6 List (java.util.List)6 Glue (io.cucumber.core.backend.Glue)5 Collections.emptyList (java.util.Collections.emptyList)5 Feature (io.cucumber.core.gherkin.Feature)4 URI (java.net.URI)4 HookDefinition (io.cucumber.core.backend.HookDefinition)3 StaticHookDefinition (io.cucumber.core.backend.StaticHookDefinition)3 Step (io.cucumber.core.gherkin.Step)3 InOrder (org.mockito.InOrder)3 Location (io.cucumber.plugin.event.Location)2 DataTableArgument (io.cucumber.core.gherkin.DataTableArgument)1 FeatureParser (io.cucumber.core.gherkin.FeatureParser)1 FeatureParserException (io.cucumber.core.gherkin.FeatureParserException)1 RuntimeOptions (io.cucumber.core.options.RuntimeOptions)1 RuntimeOptionsBuilder (io.cucumber.core.options.RuntimeOptionsBuilder)1 Gherkin (io.cucumber.gherkin.Gherkin)1