title: TestCafe - Error in fixture.beforeEach hook
body: <p>I'm doing some e2e testing with Testcafe for an application. For one of my fixtures I'm using a beforeEach. My Selector is waiting for an element to be present before it clicks on it on the page. Sometimes this test passes, and sometimes this test fails. It is very inconsistent.</p>
  
  <p>Code:</p>
  
  <pre class="lang-js prettyprint-override"><code>fixture`Ingredient Details [En]`   
      .page`${url}en/something`   
      .beforeEach(async t =&gt; {              
          await t   
            .click(button1)   
            .wait(1000)
      })
  </code></pre>
  
  <p>Error I'm getting:</p>
  
  <pre><code>1) - Error in fixture.beforeEach hook -
        The specified selector does not match any element in the DOM tree.   
  
  &gt; | Selector('#accept-button')
  </code></pre>
  
  <p>It seems that there is some sort of timing issue, whereby it isn't waiting correctly sometimes?      </p>
  
  <p>Thanks.</p>