Search in sources :

Example 1 with ScenarioTestCase

use of org.activityinfo.test.cucumber.ScenarioTestCase in project activityinfo by bedatadriven.

the class TestMain method queueFeatures.

private void queueFeatures(String environment, ResourceLoader loader, RuntimeOptions options, Module... driverModules) {
    List<Module> modules = new ArrayList<>();
    modules.add(new SystemUnderTest(url));
    modules.add(new EmailModule());
    modules.addAll(Arrays.asList(driverModules));
    TestConditions conditions = new TestConditions(environment, modules);
    Predicate<String> filter = filterPredicate();
    List<CucumberFeature> features = options.cucumberFeatures(loader);
    for (CucumberFeature feature : features) {
        for (CucumberTagStatement element : feature.getFeatureElements()) {
            if (filter.apply(feature.getPath()) || filter.apply(element.getVisualName())) {
                ScenarioTestCase testCase = new ScenarioTestCase(options, feature, element, conditions);
                queueTestCase(testCase);
            }
        }
    }
}
Also used : CucumberFeature(cucumber.runtime.model.CucumberFeature) SystemUnderTest(org.activityinfo.test.sut.SystemUnderTest) CucumberTagStatement(cucumber.runtime.model.CucumberTagStatement) OdkModule(org.activityinfo.test.webdriver.OdkModule) Module(com.google.inject.Module) ApiModule(org.activityinfo.test.driver.ApiModule) WebDriverModule(org.activityinfo.test.webdriver.WebDriverModule) EmailModule(org.activityinfo.test.driver.mail.EmailModule) EmailModule(org.activityinfo.test.driver.mail.EmailModule) ScenarioTestCase(org.activityinfo.test.cucumber.ScenarioTestCase)

Aggregations

Module (com.google.inject.Module)1 CucumberFeature (cucumber.runtime.model.CucumberFeature)1 CucumberTagStatement (cucumber.runtime.model.CucumberTagStatement)1 ScenarioTestCase (org.activityinfo.test.cucumber.ScenarioTestCase)1 ApiModule (org.activityinfo.test.driver.ApiModule)1 EmailModule (org.activityinfo.test.driver.mail.EmailModule)1 SystemUnderTest (org.activityinfo.test.sut.SystemUnderTest)1 OdkModule (org.activityinfo.test.webdriver.OdkModule)1 WebDriverModule (org.activityinfo.test.webdriver.WebDriverModule)1