Anyway to use OR in expects for Protractor

2019-02-18 19:44发布

问题:

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