我正在用Testcafe和黄瓜。如图所示,我具有以下列表行值,并且需要根据预期文本验证列表中显示的值。
我正在尝试使用下面的代码,其中数据是从功能文件传递的,
for(let i = 0 ; i < 3 ; i++){
const fieldName = Selector("div.nba-meta-action>div.nba-row>div.nba-row-left").with({ boundTestRun: testController }).withText(data[i].field);
testController.expect(fieldName.exists).ok();
const fieldValue = Selector("div.nba-meta-action>div.nba-row>div.nba-row-right").with({ boundTestRun: testController }).withText(data[i].value);
testController.expect(fieldValue.exists).ok();
}
我收到一条错误消息,内容为“ errMsg:'AssertionError:预期为true”。
有人可以在这里帮忙吗?
谢谢