title: Doing manual navigation well with page objects
body: <p>I'm fairly new to Protractor and E2E testing, but I've spent a few days researching, setting up page objects, and creating test suites, and one thing I'm wondering about is how to create good manual navigation between page objects and the actual pages.</p>
  
  <p>Let's say I have some parts on my site that can navigate to other parts of it; the page object for one of them could look something like this:</p>
  
  <pre><code>var SomePartPage = function() {
      this.btnPopUp = // button for opening some pop up
      ...
      this.openPopUp = function() {
          this.btnPopUp.click();
          return popUpPage;
      };
  };
  </code></pre>
  
  <p>I'm following the guideline that returning page objects is a good thing, and I'm assuming the promise returned by calling <code>click()</code> will be resolved before returning (as per WebDriverJS' control flow).</p>
  
  <p>But I have a setup in my test where I want to verify that this navigation takes place correctly, and sometimes it works and sometimes it doesn't. So I'm assuming it's because my pop up isn't always fully loaded by the time I want to interact with it (i.e. by the time <code>openPopUp()</code> has returned).</p>
  
  <p>Are my assumptions correct? And if so, how do I deal with this? I can use manual timers and promises of course, but I'd rather have some promise that gets resolved automatically when my pop up is fully loaded.</p>