title: Async nature of Angular Protractor tests with waits
body: <p>I have the following typescript class I use for protractor tests.  An OpenAM server is running for the auth.</p>
  
  <pre><code>import { element, by, ElementFinder, browser, ExpectedConditions} from 'protractor';
  import { BasePage } from './base.pageobject';
  import { SelectSitePage } from './select-site.pageobject';
  
  export class AuthPage extends BasePage {
      readonly url: string = '/';
  
      readonly loginMenu: ElementFinder = element(by.css('nav.profile-menu'));
      readonly loginLink: ElementFinder = element(by.cssContainingText('a', 'Login'));
      readonly logoutLink: ElementFinder = element(by.cssContainingText('a', 'Logout'));
  
      // On OpenAM login page
      readonly userNameField: ElementFinder = element(by.id('idToken1'));
      readonly passwordField: ElementFinder = element(by.id('idToken2'));
      readonly loginButton: ElementFinder = element(by.id('loginButton_0'));
      readonly aintExist: ElementFinder = element(by.id('loginButton_666'));
  
      private selectSitePage: SelectSitePage = new SelectSitePage();
  
      /**
       * Log in if are not already
       */
      public logIn() {
          this.loginMenu.click();
          this.loginLink.isPresent().then((isPresent: boolean) =&gt; {
              if (isPresent) {
                  this.loginLink.click();
  
                  this.disableWaitingForAngular();
                  var EC = ExpectedConditions;
                  let loginButtonExpected = EC.presenceOf(this.loginButton);
                  console.log('wait for login button ...');
                  browser.driver.wait(loginButtonExpected, 2000);
                  console.log('login button present');
                  this.userNameField.clear();
                  this.userNameField.sendKeys('user');
                  this.passwordField.clear();
                  this.passwordField.sendKeys('pw');
                  this.loginButton.click();
  
                  let searchBoxExpected = EC.presenceOf(this.selectSitePage.searchBox);
                  console.log('wait for searchBox ...');
                  browser.driver.wait(searchBoxExpected, 2000);
                  console.log('searchBox present');
  
                  this.enableWaitingForAngular();
              } else {
                  console.log('AuthPage / logIn - already logged in');
              }
          });
      }
  </code></pre>
  
  <p>This runs fine, however the <code>console.log</code>s come out almost immediately as if the <code>wait()</code>s have no effect on them.  However the test fails if removed so it seems they are relevant.</p>
  
  <p>Is it that the waits are only for WebDriver objects?  The doco doesn't make this clear.</p>