无论如何在量角器的期望中使用 OR [英] Anyway to use OR in expects for Protractor
本文介绍了无论如何在量角器的期望中使用 OR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以做一个x.toEqual('hello').or.toEqual('bye')
?
我希望能够做到 Expects
有多种正确的可能性.
I want to be able to do Expects
that have multiple correct possibilities.
推荐答案
您总是可以执行一个返回布尔值的 if
语句,然后检查该布尔值是否为真.
You can always do an if
statement that returns a boolean and then check if that boolean is true.
var test = false;
if(x=='hello' || x=='bye'){
test = true;
}
expect(test).toEqual(true);
这篇关于无论如何在量角器的期望中使用 OR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文