Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyway to use OR in expects for Protractor

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.

like image 259
user3779502 Avatar asked Jan 31 '26 17:01

user3779502


1 Answers

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);
like image 118
j_buckley Avatar answered Feb 03 '26 09:02

j_buckley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!