title: Protractor .ts: How do I proceed without failures, whether something appears or not, using .then(), .catch()?
body: <p>I am trying to proceed through a dialog that may or may not appear. Here's a function:</p>
  
  <p>When I run this in an it block in Jasmine/Protractor AND the catch gets run..."FALSE"...</p>
  
  <p>Jasmine completes the test, then fails with "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL"</p>
  
  <p>I can only assume this is because Jasmine/Protractor are a little too smart. I am looking for the equivalent, basically, of Java Webdriver - try/catch the wait and continue merrily on my way.</p>
  
  <p>Note that when the button does appear, the test passes no problem. "TRUE"</p>
  
  <pre><code>let okButton: ElementFinder = element(by.buttonText("OK"));
  await browser.wait(EC.visibilityOf(okButton)).then(() =&gt; {
      console.log("TRUE");
      okButton.click();
  }).catch((error) =&gt; {
      console.log("FALSE");
  })
  </code></pre>