首页 > 解决方案 > 对于打字稿中的黄瓜数据表,始终返回 true

问题描述

即使对于 dataTable 中的错误数据,以下步骤定义也始终返回 true。

你能帮我用 chai 断言纠正打字稿中的语法吗?

Then(/^Verify the following details in report$/, async (table: TableDefinition) => {

    table.rows().forEach(row => {
        return expect(homepage.getDamagedPartyName()).to.eventually.equal(row[0]);

    });
});

标签: typescriptcucumbercucumberjs

解决方案


我希望问题出在 return 关键字上。删除 return 并尝试如下所示:

期望(homepage.getDamagedPartyName()).to.equal(row[0]);


推荐阅读