簡體   English   中英

有沒有辦法在 testcafe 的 assert 語句中傳遞多個選項?

[英]Is there a way to pass multiple options in assert statement in testcafe?

我需要在我的斷言語句中傳遞多個選項。 下面是斷言語句

等待 t.expect(methodName.tableInput.innerText).eql('' or '\n'); //這是不正確的

我需要檢查它是否為空值。 但是在 jenkins 上它說 '\n' 需要通過,但本地 '\n' 失敗

請幫忙

您不能在assert 語句中傳遞多個選項。 我建議您使用以下方法

 const text = await Selector(‘yourSelector’).innerText;
 await t.expect(text === ‘ ‘ || text === ‘\n’).ok( );

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM