Anyway to use OR in expects for Protractor

China☆狼群 提交于 2019-12-01 07:15:24

问题


It is possible to do a x.toEqual('hello').or.toEqual('bye')?

I want to be able to do Expects that have multiple correct possibilities.


回答1:


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);


来源:https://stackoverflow.com/questions/24434826/anyway-to-use-or-in-expects-for-protractor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!