protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Feature Request: provide the possibility of a 3rd parameter of browser.wait() to be true/false, not only error message

Open zwingliernst opened this issue 9 years ago • 0 comments

Feature Request: provide the possibility of a 3rd parameter of browser.wait() to be true/false, not only error message

The idea:

browser.wait(EC.presenceOf(elm),500,false) //should return false, if not present within timeout, else true

instead of:

elm.isPresent().then(function(result){
    //new async task
    if(result){
        //do true
    } //eventuelly do else/false
})

So I can click away an eventually appearing warning message, by doing this:

if(browser.wait(EC.presenceOf(elm),500,false)){
    warningMsgOk.click() //no new asynchronous tasks, but a straight forward conditional check.
}

See the related question on StackOverflow here

Advantages:

  • less complexity. Possibility to stay synchronous.
  • Is this a breaking change? => existing functionality shouldn't be affected, as true/false can be recognized as different from 'String' as parameter.

zwingliernst avatar Nov 02 '17 10:11 zwingliernst