title: CircleCI Protractor wait for server to start
body: <p>I am trying to use Protractor on my project through CircleCI for E2E testing.</p>
  
  <p>Starting my server takes a long time (around 2 minutes), and I am getting the following error on my tests (which shows locally when the server has not started):</p>
  
  <pre><code>Failed: Angular could not be found on the page http://test.blah.dev:3000/auth/login : retries looking for angular exceeded
  </code></pre>
  
  <p>Here is my <code>circle.yml</code>:</p>
  
  <pre><code>machine:
    node:
      version: 5.11.0
  dependencies:
    post:
      - npm run serve-dist: # starts the server
            background: true
      - sleep 150 # wait for the server to start
  test:
    pre:
      - npm install -g protractor
      - webdriver-manager update
      - webdriver-manager start:
            background: true
  </code></pre>
  
  <p>I then run <code>npm test</code>, which includes the command <code>protractor conf.js</code></p>
  
  <p>I want to figure out a better way to wait for the server to start on CircleCI. Can someone tell me what I am doing wrong?</p>