title: Have to use manual wait() to get CodeceptJS/Puppeteer custom helper to see table(td tr)
body: <p>I have a codeceptjs/puppeteer project and am building a custom helper for accessing information in tables.  I have been able to make this work, but only by putting a two second wait in my test step before calling on the async function in my custom helper class.  Given that this is all based on async/await, I have to believe I am just missing something and there is a clean way to do this.</p>
  <p>Function from my helper class.</p>
  <pre><code>  async getRowCount() { 
      //const browser = this.helpers['Puppeteer'].browser;
      const page = this.helpers['Puppeteer'].page;
  
      page.waitForSelector('tbody');
      let rowCount = await page.$$eval('tbody tr', rows =&gt; rows.length);
      return rowCount;
  
      // These work
      // page.waitForSelector('a[href=&quot;#/site/create&quot;]');
      // page.click('a[href=&quot;#/site/create&quot;]');
      
    }
  </code></pre>
  <p>My codeceptjs scenario is below.</p>
  <pre><code>Scenario.only('Table check ALL', async (I, loginAs) =&gt; {
    loginAs('bob');
    I.say(await I.getRowCount());
    I.wait(3);
  });
  </code></pre>
  <p>When the code is as shown above, my row count that is returned in always 0.</p>
  <p>However, if I put a 1 second wait just before the I.getRowCount() function, then the correct total number of rows for the tbody tr selector is returned.</p>
  <p>If anyone can help me understand why this is happening and what I can do to fix it so I don't have to pepper my code with manual wait steps to accommodate these helper functions (core &quot;feature&quot; of codeceptjs), I would greatly appreciate it.</p>
  <p>Thank you!</p>