Protractor e2e control flow and time outs
<p>I use protractor to test an angular app and I have a weird problem. Occasionally or since recently, protractor has been stalling/slowing down considerably.</p>

<p>I narrowed down to the issue and can see that it's taking a long time for a simple <code>someElement.getText().then(...)</code> to resolve; so the <code>.then(...)</code> part never executes; however, putting an <code>allScriptTimeOut: 500 000</code> waits untils that promise eventually resolves which takes about 6mins to resolve (very inconvenient!).</p>

<p>Again, waiting with <code>allScriptTimeOut: 500 000</code> will eventually work but takes too long.</p>

<p>Another solution to this extreme slowdown is to tell protractor hey Protractor, don't wait for Angular to finish fufilling all promises and asynchronous background tasks and just go on, don't wait for angular and this would work with <code>browser.ignoreSynchronization = true;</code></p>

<p>However setting this boolean to true is problematic because it basically treats your whole angular app as a NON-angular app and never waits for angular and thus causing all sort of issues with Protractor. Another complication is that our app is NOT entirely angular, some pages are non-angular; anyways; here's my question:</p>

<p>Is there a way to hook into the controlflow queue and basically poll or query the queue by asking hey controlflow queue tell me whenever any action that was enqueued is taking longer than 11sec? and if yes, set <code>browser.ignoreSynchronization = true</code>; a sudo-like code would look like this:</p>

<pre><code>protractor.controlflow(function(delay){
  if(delay &gt; 11 sec){
    browser.ignoreSynchronization = true;
  }else{
    browser.ignoreSynchronization = false;
  }
});
</code></pre>

<p>This might not make sense syntactically but i'm more interested in the concept than properly written javascript;</p>

<p>Thanks again hopefully that's clear enough to understand my problem</p>

<p><strong>UPDATES:</strong> </p>

<p>I checked again and basically, Protractor is able to click on most button, but then it gets to another button which was at the bottom of the screen, but I scrolled first to bring button into view, then tried to click on it and it's just taking 6mins then it finally clicks on that button. </p>

<p><strong><em>Why is it taking this long before it finally successfully clicks on that button?</em></strong></p>