lundi 20 juin 2016

match multiple values with one expected values, always try to match only first value and fails

I am using bellow mentioned code to compare multiple values with one expected values and if the text matches with anyone of them my test should pass :

Promise.all([Summ,Desc,Comment]).then(function(values){
    console.log("values = " +values);
    expect(values[0]||values[1]||values[2]).toMatch('searchtxt');
});

But with this code it always try to match first (values[0]), if this does not match then my test will fail.

How can I change it so that protractor looks for all 3 values and then if anyone of them matches my test should pass.

Aucun commentaire:

Enregistrer un commentaire