title: Error: function timed out, ensure the promise resolves within - Cucumber js
body: <p>I am using protractor with cucumber js
  i have all function with async and await and also set global timeout</p>
  <p>var {setDefaultTimeout} = require('cucumber');
  setDefaultTimeout(60 * 1000);</p>
  <pre><code>Then('I click on tab', async ()=&gt; {
    
      await organizationOperation.clickHeaderTab();
  
    });
  </code></pre>
  <p>Question - if i use wrong xpath/element is not located in UI, in that case getting below error</p>
  <p>Error: function timed out, ensure the promise resolves within 60000 milliseconds</p>
  <p>It should throw an error locator not found (locator text)</p>
  <p><strong>or if directly i use</strong></p>
  <pre><code>  Then('I click on tab', async ()=&gt; {
        
   const d = await $('.xxxxx').getText();
       console.log(d)
  
  });
  </code></pre>
  <p>getting same error   --&gt;  Error: function timed out, ensure the promise resolves within 30000 milliseconds</p>
  <p>Why it is not showing - element not found error on console..?</p>