title: Protractor - wait after switch to window or iframe
body: <p>I'm trying to replace 'timeouts' or 'Sleeps' with 'wait' for the test to be faster. I was not able to find the right way to wait for switching to window or iframe that doesn't have identifier. </p>
  
  <p>For example:</p>
  
  <pre><code>browser.sleep(5000);
  browser.driver.switchTo().window(handles[0]).then(function() {
      // login.logout();
  });
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>flow.timeout(5000);
  
  browser.switchTo().frame(0);
  </code></pre>