我有一个代码,我想将方法调用值放在方法的名称中。
@Unroll
def 'check #file other text'() {
setup:
def file = allProperties.keySet().getAt(0)
...
where:
...
现在我创建特殊变量,其目的仅用于命名方法。我可以做类似的事情:
static def allProperties
def setupSpec(){
allProperties== [1: 'asd', 2: 'ddd']
}
@Unroll
def 'check #allProperties.keySet().getAt(0) other text'() {
....
where:
...
编辑:添加 setupSpec()