// Groovy Steps - can be stateful per story.
final Storing store = (Storing) new Storing().wrap(new CompositeInjection(new ConstructorInjection(),
new SetterInjection("set", "setMetaClass")));
ClassLoader currentClassLoader = this.getClass().getClassLoader();
final DefaultClassLoadingPicoContainer pageObjects = new DefaultClassLoadingPicoContainer(currentClassLoader,
store, primordial);
pageObjects.change(Characteristics.USE_NAMES);
// This loads all the Groovy page objects - can be stateful
pageObjects.visit(new ClassName("pages.Home"), ".*\\.class", true,
new DefaultClassLoadingPicoContainer.ClassVisitor() {
public void classFound(@SuppressWarnings("rawtypes") Class clazz) {
pageObjects.addComponent(clazz);
}
});
ClassLoadingPicoContainer steps = pageObjects.makeChildContainer("steps");
steps.addComponent(new CacheFlusher(store));
steps.addComponent(new ClassName("HousekeepingSteps"));
steps.addComponent(new ClassName("EtsyDotComSteps"));
// Before And After Steps registered by instance
steps.addComponent(new PerStoryWebDriverSteps(driverProvider));