Search in sources :

Example 1 with Cucumber

use of cucumber.api.junit.Cucumber in project cucumber-jvm by cucumber.

the class CucumberTest method testThatFileIsNotCreatedOnParsingError.

@Test
public void testThatFileIsNotCreatedOnParsingError() throws Exception {
    try {
        new Cucumber(FormatterWithLexerErrorFeature.class);
        fail("Expecting error");
    } catch (CucumberException e) {
        assertFalse("File is created despite Lexor Error", new File("lexor_error_feature.json").exists());
    }
}
Also used : CucumberException(cucumber.runtime.CucumberException) Cucumber(cucumber.api.junit.Cucumber) File(java.io.File) Test(org.junit.Test)

Example 2 with Cucumber

use of cucumber.api.junit.Cucumber in project cucumber-jvm by cucumber.

the class CucumberTest method finds_features_based_on_explicit_root_package.

@Test
public void finds_features_based_on_explicit_root_package() throws IOException, InitializationError {
    Cucumber cucumber = new Cucumber(ExplicitFeaturePath.class);
    assertEquals(3, cucumber.getChildren().size());
    assertEquals("Feature: FA", cucumber.getChildren().get(0).getName());
}
Also used : Cucumber(cucumber.api.junit.Cucumber) Test(org.junit.Test)

Example 3 with Cucumber

use of cucumber.api.junit.Cucumber in project cucumber-jvm by cucumber.

the class CucumberTest method finds_no_features_when_explicit_feature_path_has_no_features.

@Test
public void finds_no_features_when_explicit_feature_path_has_no_features() throws IOException, InitializationError {
    Cucumber cucumber = new Cucumber(ExplicitFeaturePathWithNoFeatures.class);
    List<FeatureRunner> children = cucumber.getChildren();
    assertEquals(emptyList(), children);
}
Also used : Cucumber(cucumber.api.junit.Cucumber) Test(org.junit.Test)

Example 4 with Cucumber

use of cucumber.api.junit.Cucumber in project cucumber-jvm by cucumber.

the class CucumberTest method finds_features_based_on_implicit_package.

@Test
public void finds_features_based_on_implicit_package() throws IOException, InitializationError {
    Cucumber cucumber = new Cucumber(ImplicitFeatureAndGluePath.class);
    assertEquals(3, cucumber.getChildren().size());
    assertEquals("Feature: FA", cucumber.getChildren().get(0).getName());
}
Also used : Cucumber(cucumber.api.junit.Cucumber) Test(org.junit.Test)

Aggregations

Cucumber (cucumber.api.junit.Cucumber)4 Test (org.junit.Test)4 CucumberException (cucumber.runtime.CucumberException)1 File (java.io.File)1