【问题标题】:BDD Cucumber tests via jUnit通过 jUnit 进行 BDD Cucumber 测试
【发布时间】:2012-09-04 10:43:26
【问题描述】:

我有任何通过 jUnit 手动运行黄瓜的示例吗?

我有一个带有 @RunWith(Cucumber.class) 的简单空类,其中包含我的所有功能文件。

import cucumber.junit.Cucumber;
import org.junit.runner.RunWith;


@RunWith(Cucumber.class)
public class RunCukesTest {
}

运行它的简单junit测试:

@Test
    public void cucumberFirstPartTests()throws Exception{
        Cucumber cucumber = new Cucumber(RunCukesFirstPart.class);
        RunNotifier notifier = new RunNotifier();
        cucumber.run(notifier);
    }

是否有任何用于过滤手动测试、使用运行器调度程序和黄瓜测试描述的示例?看过文档,但对我来说还不够。我将不胜感激任何链接。谢谢。

【问题讨论】:

  • 这里没有足够的细节。发布您的 Spring 配置和测试类的相关 sn-ps。

标签: java spring testing cucumber bdd


【解决方案1】:

您可以使用@TAGNAME 使用任意数量的标签标记每个场景/功能 鉴于此,您可以告诉跑步者运行一组选定的标签

@RunWith(Cucumber.class)
@Cucumber.Options(tags = {"@TAGNAME"})

这就是你所追求的吗?

【讨论】:

  • 很遗憾没有,但感谢您的回复。我正在寻找通过junit运行黄瓜测试时过滤黄瓜测试的示例-在junit中过滤而不是在Runwith控制器的帮助下进行过滤。然后我写了自己的过滤器。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-27
  • 2020-02-06
  • 1970-01-01
  • 1970-01-01
  • 2016-02-15
  • 2020-12-27
  • 2020-10-19
相关资源
最近更新 更多