Search in sources :

Example 1 with FeatureLoader

use of cucumber.runtime.model.FeatureLoader in project page-factory-2 by sbtqa.

the class FragmentCacheUtils method cacheFragmentsToFeatures.

static List<CucumberFeature> cacheFragmentsToFeatures(Class clazz, List<CucumberFeature> features) {
    if (PROPERTIES.getFragmentsPath().isEmpty()) {
        return features;
    } else {
        ClassLoader classLoader = clazz.getClassLoader();
        ResourceLoader resourceLoader = new MultiLoader(classLoader);
        List<CucumberFeature> fragmentsRaw = new FeatureLoader(resourceLoader).load(Collections.singletonList(FeaturePath.parse(PROPERTIES.getFragmentsPath())));
        return Stream.concat(features.stream(), fragmentsRaw.stream()).collect(Collectors.toList());
    }
}
Also used : ResourceLoader(cucumber.runtime.io.ResourceLoader) CucumberFeature(cucumber.runtime.model.CucumberFeature) MultiLoader(cucumber.runtime.io.MultiLoader) FeatureLoader(cucumber.runtime.model.FeatureLoader)

Aggregations

MultiLoader (cucumber.runtime.io.MultiLoader)1 ResourceLoader (cucumber.runtime.io.ResourceLoader)1 CucumberFeature (cucumber.runtime.model.CucumberFeature)1 FeatureLoader (cucumber.runtime.model.FeatureLoader)1