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));
steps.addComponent(new WebDriverScreenshotOnFailure(driverProvider, configuration.storyReporterBuilder()));
// steps.addComponent(new WebDriverPageDumpOnFailure(driverProvider,
// configuration.storyReporterBuilder()));