title: NightmareJS wait(selector) not working with dojo-based webpage
body: <p>I'm trying to scrape a webpage that was made using the <a href="https://dojotoolkit.org/" rel="nofollow">Dojo Webkit</a> with <a href="http://www.nightmarejs.org/" rel="nofollow">NightmareJS</a>.  The problem I'm encountering is that while trying to click buttons to progress through the pages, I need to make sure that the buttons themselves are loaded before trying to click them otherwise I get errors such as: "Unable to find element by selector: selector", which is to be expected.</p>
  
  <p>Adding in wait(milliseconds) works, but in a situation where the server is slow or there are a larger number of things to show, the loading could overrun the wait time, which is something I obviously want to avoid.  So then I tried using the wait(selector) method, and what happens is that it just stalls out at that point.  The Electron browser is open during all of this, and the page has loaded completely successfully, including the button with the selector, I can click it and do everything manually.</p>
  
  <p>Here's an example of what I am trying to do:</p>
  
  <pre><code>nightmare
    .click('#button')
    .wait('#otherbutton')
    .click('#otherbutton')
    .catch((error) =&gt; console.log('Error:...', error));
  </code></pre>
  
  <p>The first button gets clicked and the page loads, but then it hangs on there and the second click function never happens.</p>
  
  <p>Edit: After doing some research on the <a href="https://dojotoolkit.org/" rel="nofollow">Dojo Webkit</a> I found that it has a <a href="https://dojotoolkit.org/reference-guide/1.9/loader/" rel="nofollow">special loader</a> that I believe is messing with how the webpage loads, though because I'm not sure how the wait(selector) checks against the page to determine whether the element has loaded into the page, I can't be sure that the dojo loader is the root cause, and even then I'd still appreciate some sort of workaround if it is.</p>