我使用的是 量角器-黄瓜-框架。
以下是功能文件
Feature: welcome to protractor cucumber
Scenario Outline: DataTable
Given I am learning
Then I print following table
Examples:
| First | Middle |
| qwerty | xyz |
在步骤定义文件中,我想打印表格数据。
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)