【发布时间】:2015-06-26 13:05:47
【问题描述】:
我正在使用 GebReportingSpec。
我想获取将使用 setup 方法执行的测试名称。
我从testName.methodName 得到空输出
我的代码 sn-p 如下:
class CRMAppLoginSpec extends GebReportingSpec {
@Rule
public TestName testName = new TestName()
setup()
{
String methodName = testName.methodName;
println (methodName)
}
def "mytest"(String myName)
{
given: "This is my test case in geb-spock"
when: "capture the parameter"
def var1 = myName
then: "Display input parameter"
println ("Welcome to geb-spock : ${var1}" )
where:
myName << ["Debasish", "Prashant"]
}
【问题讨论】:
-
你想达到什么目的?你用这个名字干什么?
标签: spock