私はいくつかの似たようなシナリオを持っていますが、自分のカスタムThucydidesJUnitStoriesを作成していました。私の場合、それぞれのストーリーをステップごとに読み込み、競合を避ける必要がありました。例
public class CustomThucydidesJUnitStories extends ThucydidesJUnitStories {
Logger logger = LoggerFactory.getLogger(CustomThucydidesJUnitStories.class);
private Configuration configuration;
private List<Format> formats = Arrays.asList(CONSOLE, STATS, HTML);
@Test
@Override
public void run() throws Throwable {
List<String> storyPaths = storyPaths();
logger.info("Total stories to run are {}", storyPaths.size());
//HERE YOU CAN SORT THE storyPaths as you wish
for(String storyPath : storyPaths) {
Embedder embedder = configuredEmbedder();
embedder.useConfiguration(configuration());
String storyName = storyPath.substring(storyPath.lastIndexOf("/") + 1, storyPath.indexOf(".story"));
logger.info("Running story {}", storyName);
embedder.useStepsFactory(ThucydidesStepFactory.withStepsFromPackage(getRootPackage() + "." + storyName, configuration()).andClassLoader(getClassLoader()));
embedder.useEmbedderControls(ignoreFailsEmbedderControls());
embedder.runStoriesAsPaths(Lists.newArrayList(storyPath));
}
}
public EmbedderControls ignoreFailsEmbedderControls() {
return new EmbedderControls().doIgnoreFailureInStories(true).doIgnoreFailureInView(true);
}
@Override
public Configuration configuration() {
if (configuration == null) {
net.thucydides.core.webdriver.Configuration thucydidesConfiguration = getSystemConfiguration();
configuration = ThucydidesJBehave.defaultConfiguration(thucydidesConfiguration, formats, this);
}
return configuration;
}
}