无法使用JunitStory跳过Jbehave中的场景 [英] Not able to skip scenarios in Jbehave with JunitStory
问题描述
我一直在关注很多帖子&已集成的线程 跳过方案的逻辑.仍然无法使其成功运行. 当我把 "configuredEmbedder().useMetaFilters(Arrays.asList("-skip)));" 或者 "configuredEmbedder().useMetaFilters(Arrays.asList(" + skip));" 在Storyrunner,java文件中,没有执行任何方案. 当我删除该行时,将执行所有方案. 我的.story文件在4种情况中的2种中具有元跳过". 有人可以看看这个&让我知道我可能错过了什么.
I have been following lot of posts & threads based on which have integrated the logic to skip scenarios. Still not able to get it working successfully. When i put the "configuredEmbedder().useMetaFilters(Arrays.asList("-skip"));" OR "configuredEmbedder().useMetaFilters(Arrays.asList("+skip"));" in the storyrunner,java file, none of the scenarios are executed. And when I remove the line, all the scenarios are executed. My .story file has "Meta skip" in 2 of the 4 scenarios. Can someone please look into this & let me know what I may have missed.
下面是所有配置所在的类 公共类SampleStory扩展了JUnitStory {
Below is the class where all the configs reside public class SampleStory extends JUnitStory {
public SampleStory() {
configuredEmbedder().embedderControls()
.doGenerateViewAfterStories(true)
.doIgnoreFailureInStories(false).doIgnoreFailureInView(true)
.useStoryTimeoutInSecs(60);
configuredEmbedder().useMetaFilters(Arrays.asList("+skip"));
/* removeStartIgnoreCase */
// StringUtils.removeStartIgnoreCase("","");
}
@Override
public Configuration configuration() {
Configuration configuration = new MostUsefulConfiguration();
Properties viewResources = new Properties();
viewResources.put("decorateNonHtml", "true");
viewResources.put("reports", "ftl/jbehave-reports-with-totals.ftl");
// Where to find the stories
StoryLoader storyLoader;
storyLoader = new LoadFromRelativeFile(
CodeLocations.codeLocationFromClass(this.getClass()));
configuration.useStoryLoader(storyLoader);
StoryReporterBuilder storyReporterBuilder;
storyReporterBuilder = new StoryReporterBuilder();
// storyReporterBuilder.withDefaultFormats();
storyReporterBuilder.withDefaultFormats();
// storyReporterBuilder.withViewResources(viewResources).withFormats(CONSOLE,
// TXT, HTML, XML);
// storyReporterBuilder.withFormats();
// CONSOLE reporting
configuration.useStoryReporterBuilder(storyReporterBuilder);
return configuration;
}
/*
* @Override public Embedder configuredEmbedder() {
* super.configuredEmbedder().useMetaFilters(Arrays.asList("-skip"));
*
*
* return super.configuredEmbedder(); }
*/
@Override
public InjectableStepsFactory stepsFactory() {
return new InstanceStepsFactory(configuration(), new SampleSteps());
}
Snenairo.story
Scenario: This is scenario 1
Given I say hello
When I say bye
Then whatever
Scenario: This is scenario 2
Meta : @skip
Given I say ello
When I say ye
Then whatever
还有另一类,其中存在所有g/w/t的绑定方法.
There is another class where all the binding menthods for g/w/t exists.
推荐答案
从jbehave开发人员小组获得了答复-出现语法错误 我做到了 meta:@跳过 但这应该是 meta:@skip
Got an reply from the group of the devs of jbehave - there was a syntax error i did meta: @skip but it should have been meta : @skip
这篇关于无法使用JunitStory跳过Jbehave中的场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!