我刚刚开始使用一种叫做 testcafe 的东西。我希望断言我已收到带有选择器“#audit > h4”的列表。它需要 >= 1。我不确定用于 >= 1 的语法,或者它应该放在 JS 的新地方。
到目前为止,这是我的代码,第二个测试需要建议:
fixture `UI Tests`
.page `http://localhost:8080/`;
test('Clicking the search button', async t => {
await t
.click ('#search-result > div > div > button');
});
test('Asserting a list of audits', async t => {
await t
.expect('#audit > h4')
});
最佳答案
终于找到答案了
.expect(Selector(page.auditListId).count).gte(2);
关于javascript - 使用 testcafe 在 Javascript 中断言数组列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43982395/