使用testcafe在Javascript中断言数组列表

使用testcafe在Javascript中断言数组列表,javascript,testing,automated-tests,e2e-testing,testcafe,Javascript,Testing,Automated Tests,E2e Testing,Testcafe,我刚开始使用一种叫做testcafe的东西。我希望声明我收到了一个带有选择器“#audit>h4”的列表。它需要大于等于1。我不确定>=1的语法是什么,也不确定它在JS中的新位置 以下是我目前为止的代码第二个测试需要建议: fixture `UI Tests` .page `http://localhost:8080/`; test('Clicking the search button', async t => { await t .click ('#s

我刚开始使用一种叫做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);

试着看一下这里的文档:是的,我昨天一整天都在讨论这个问题,但仍然不能帮助我解决我最初的问题。