Suppose I'm need to wait for some result, but there also can appear another results, so in this case I use 2 wait(), but problem is what I can't cancel one wait() if after execution one of them was appeared
Example:
async waitForAction(): Promise<any> {
try{
await driver.wait(until.elementLocated(button)); // 1st wait
await driver.wait(until.elementLocated(unexpectedErr)); // 2nd wait
await driver.findElement(button).click()
// how to cancel 2nd wait if 1st appeared
} catch(e) {
console.log(e.message)
}
}