【发布时间】:2018-09-16 21:03:22
【问题描述】:
功能文件
Feature: Shopper can add an item to their Grocery List
@kk
Scenario: Mutate multiple User Skills at the same time
Then If I click the row "Summary" then I should the following nested information`
| Tax | 11.50 |
| Gratuity | 4.50 |
| Total | 26.59 |
步骤定义文件
Then(/^If I click the row "([^"]*)" then I should the following nested information$/, function (rowName, data){
cconsole.log("rowName-----"+rowName)
console.log("data-----"+data)
data = dataTable.raw();
console.log(data);`
});
错误日志 如果我单击“摘要”行,那么我应该以下嵌套信息
dataTable is not defined
ReferenceError: dataTable is not defined
at World.<anonymous> (/Users/src/__acceptance__/stepDefinition/android/wdio.apps.stepdefs.js:12:3)
at new Promise (<anonymous>)
at new F (/Users/wdio-cucumber-framework/node_modules/core-js/library/modules/_export.js:36:28)
请帮我解决这个问题.....
【问题讨论】:
-
您能否格式化代码示例,以便人们可以看到您的行是如何中断的?这可能会影响 cucumber 如何解释您的场景。
-
感谢您的回复.....我已经编辑了代码.....无论我在功能文件中传递什么,都无法在步骤定义中获取数据表数据。
标签: cucumberjs