title: Protractor e2e Tests Login Redirection
body: <p>Currently have a partial end-to-end test that enters a username/password and clicks 'sign in'.</p>
  
  <p>It does that successfully, but concludes at a "thanks you're logged in" page, instead of being redirected to the 'account portal' or 'dashboard', the way it would if I logged in through the browser.\</p>
  
  <p>New to this project but we are using OAuth.</p>
  
  <p><strong>Main question: Does this sound like a need for http mocking?</strong></p>
  
  <p>Further details:</p>
  
  <p>spec.js</p>
  
  <pre><code>describe('login page', function() {
      browser.driver.get('http://url.path/login');
      it('should render login page', function() {
  
        // Checking the current url
        var currentUrl = browser.driver.getCurrentUrl();
        expect(currentUrl).toMatch('/login');
      });
      it('should sign in', function() {
  
        // Find page elements
        var userNameField = browser.driver.findElement(By.id('username'));
        var userPassField = browser.driver.findElement(By.id('password'));
        var userLoginBtn  = browser.driver.findElement(By.id('loginbtn'));
  
        // Fill input fields
        userNameField.sendKeys('test@user.com');
        userPassField.sendKeys('1234');
  
        // Ensure fields contain what we've entered
        expect(userNameField.getAttribute('value')).toEqual('test@user.com');
        expect(userPassField.getAttribute('value')).toEqual('1234');
  
        // Click to sign in - waiting for Angular as it is manually bootstrapped.
        userLoginBtn.click().then(function() {
          browser.waitForAngular();
          expect(browser.driver.getCurrentUrl()).toMatch('/success');
        }, 10000);
      });
  });
  </code></pre>
  
  <p>If I quickly click on the testing window, I can see it successfully reaches the 'success' page - but it does not redirect to the dashboard (it redirects when you manually sign in, through the browser). How can I continue this test to remain signed in and access the dashboard like a user would?</p>
  
  <p>// New to the project, angular and and protractor.</p>
  
  <p><strong>EDIT - Summarizing this a bit:</strong></p>
  
  <ul>
  <li>I would like protractor to begin tests on the <em>/login</em> page</li>
  <li>Protractor should find and fill out the username and password fields, then click Login</li>
  <li>Protractor successfully log in, to see a <em>/thankyou</em> page, then immediately redirect to the user's <em>/dashboard</em> page</li>
  <li><em>Maybe I'm missing a step, do we need to manually redirect in Protractor tests?</em></li>
  </ul>
  
  <p>(When a user manually logs in through the browser, they don't see the <em>/thankyou</em> page - it's a quick redirect to <em>/dashboard</em> . Protractor does not reach the dashboard page.</p>