title: How to wait for 2 selectors with CasperJS?
body: <p>In my use case, the only way to know when a page is loaded is to wait for 2 selectors.</p>
  
  <p>What's the best way to do that with CasperJS?</p>
  
  <p>Here is my solution:</p>
  
  <pre><code>casper.waitUntilVisible2 = function(selector1, selector2, then, onTimeout, timeout) {
    casper.waitUntilVisible(selector1, function () {
      casper.waitUntilVisible(selector2, then, onTimeout, timeout)
    }, onTimeout, timeout);
  }
  </code></pre>