You cannot access banned topics.
在做失败的用例重跑功能,在网上看到这样的写法
第一次跑:
@CucumberOptions(format = {"rerun:target/rerun.txt"})
第二次跑:
@CucumberOptions(features = {"@target/rerun.txt"})
真正跑的时候遇到这样的问题,第一次生成的文件里只是记录了 feature 的文件名并没有具体写全路径,导制第 2 次跑时,找不到这个 feature 文件,
不知道该怎么配置?有谁遇到这样的问题吗?
按道理是会从你的 classpath 里面拿的。不会出现这种问题。我试验了下,
@CucumberOptions(plugin = {"pretty"}, format = "rerun:target/sample.txt")
会在 target 目录下生成 sample.txt 文件。里面记录了 feature 路径。比如你的 feature 放在 resource 下面,
➜ resources git:(master) ✗ tree
.
└── skeleton
├── belly.feature
└── belly2.feature
1 directory, 2 files
运行的时候,会讲这些文件按路径拷贝到 target 下面,然后执行。然后如果出错,
那就会在 sample.txt 里写 skeleton/belly2.feature:3
然后再次运行的话,用下面的
@CucumberOptions(features = {"@target/sample.txt"})
就会从 classpath 即 test-class 里面读取出来。
我是在 resource 下再建了一个 feature 文件夹,所以就没有找到,后来把这个文件夹加到资源文件中就可以了。