【发布时间】:2019-11-19 17:03:51
【问题描述】:
我想出的方法是这样的
Given(
`Step1`,
async function() {
const IwantToUseThisObj = {
A: 'a',
B: 'b'
}
this.IwantToUseThisObj = IwantToUseThisObj
}
)
Then(`Step2`, async function() {
IwantToUseThisObj = this.IwantToUseThisObj
})
但我不确定这是否是最佳做法,如果我需要大量使用它,它看起来非常重复,
有更好的方法吗?我只想使用我在 Given 步骤中使用的值
【问题讨论】:
-
您是否尝试将数据从一个步骤传递到另一个步骤?
标签: javascript selenium-webdriver bdd cucumberjs