2017-05-15 42 views
0

嗨,我剛開始使用一些名爲testcafe的東西。我正在尋找斷言,我收到了選擇器'#audit> h4'的列表。它需要大於等於1.我不確定用於> = 1的語法,或者它應該被放置爲「對JS來說是新的」。在Javascript中使用testcafe聲明一個數組列表

這裏是我到目前爲止的代碼的第二次測試是需要諮詢一個:

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') 
}); 
+0

嘗試在文檔看這裏:HTTP://devexpress.github .io/testcafe/documentation/test-api/assertions/assertion-api.html#great-than-equal-to – Woodrow

+0

是的,我昨天整天打開,但仍然沒有幫我解決我的問題。 – Peter

回答

2

找到了答案最終

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