use of org.activityinfo.test.sut.SystemUnderTest in project activityinfo by bedatadriven.
the class TestMain method queueTestMethods.
private void queueTestMethods(String environment, 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();
ClassLoader classLoader = getClass().getClassLoader();
ClassFinder classFinder = new ResourceLoaderClassFinder(new MultiLoader(classLoader), classLoader);
Collection<Class<?>> testClasses = classFinder.getDescendants(Object.class, "org.activityinfo.test.ui");
for (Class<?> testClass : testClasses) {
for (Method method : JUnitUiTestCase.findTestMethods(testClass)) {
if (filter.apply(method.getName()) || filter.apply(method.getDeclaringClass().getName())) {
queueTestCase(new JUnitUiTestCase(method, conditions));
}
}
}
}
use of org.activityinfo.test.sut.SystemUnderTest 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);
}
}
}
}
Aggregations