无论如何使用OR期望Protractor [英] Anyway to use OR in expects for Protractor
本文介绍了无论如何使用OR期望Protractor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以做 x.toEqual('hello')。or.toEqual('bye')
?
我希望能够预期
有多种正确的可能性。
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期望Protractor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文