How to do conditional browser interactions with intern
问题 With the promised web driver I would like to check if an element exists on the page, then login if it does, otherwise continue with the promise chain. Is this not possible at the moment due to https://github.com/theintern/intern/issues/14? 回答1: In Intern 2, simply use the normal find command: var remote = this.remote; remote.get(url) .findById('foo') .then(function (element) { // exists }, function () { // does not exist }); In Intern 1, if you need to conditionally branch, you’ll need to