TypeError: table.rows is not a function - while accessing examples from feature file in protractor
TypeError: table.rows is not a function - while accessing examples from feature file in protractor
我正在使用 protractor-cucumber-framework
这是功能文件
Feature: welcome to protractor cucumber
Scenario Outline: DataTable
Given I am learning
Then I print following table
Examples:
| First | Middle |
| qwerty | xyz |
在步骤定义文件中,我想打印 table 数据。
Given(/^I am learning$/, async () => {
console.log("I am learning");
});
Then(/^I print following table$/, (table: TableDefinition) => {
const tableData = table.rows();
console.log(tableData[0][0]);
});
但是出现以下错误
TypeError: table.rows is not a function
at World.(anonymous) (/.../Protr_cucumber/stepDef/Sample_stepDef.ts:9:29)
我正在使用 protractor-cucumber-framework
这是功能文件
Feature: welcome to protractor cucumber
Scenario Outline: DataTable
Given I am learning
Then I print following table
Examples:
| First | Middle |
| qwerty | xyz |
在步骤定义文件中,我想打印 table 数据。
Given(/^I am learning$/, async () => {
console.log("I am learning");
});
Then(/^I print following table$/, (table: TableDefinition) => {
const tableData = table.rows();
console.log(tableData[0][0]);
});
但是出现以下错误
TypeError: table.rows is not a function
at World.(anonymous) (/.../Protr_cucumber/stepDef/Sample_stepDef.ts:9:29)