【问题标题】:Asserting an array list in Javascript using testcafe使用 testcafe 在 Javascript 中断言数组列表
【发布时间】:2017-05-15 14:43:42
【问题描述】:

我刚刚开始使用名为 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')
});

【问题讨论】:

标签: javascript testing automated-tests e2e-testing testcafe


【解决方案1】:

终于找到答案了

.expect(Selector(page.auditListId).count).gte(2);

【讨论】:

    猜你喜欢
    • 2019-04-29
    • 1970-01-01
    • 2020-05-13
    • 2020-07-21
    • 1970-01-01
    • 2020-06-09
    • 1970-01-01
    • 2020-03-17
    相关资源
    最近更新 更多