protractor
protractor copied to clipboard
Feature Request: provide the possibility of a 3rd parameter of browser.wait() to be true/false, not only error message
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/falsecan be recognized as different from'String'as parameter.