title: Manage Protractor tests with a single Gulp task
body: <p>I'm trying to get e2e testing going with on my angular project using Gulp.</p>
  
  <p>I'm able to get it working, but only if I manually launch a standalone selenium server using <code>webdriver-manager start</code> in a seperate terminal window.</p>
  
  <p>Ideally I would like my gulp task to manage starting and stopping the server so as to not add more overhead for my team to run these tests.</p>
  
  <p>I got set up following the instructions here:</p>
  
  <blockquote>
    <p><a href="https://github.com/mllrsohn/gulp-protractor" rel="noreferrer">https://github.com/mllrsohn/gulp-protractor</a></p>
  </blockquote>
  
  <p>They describe 2 options for starting the selenium server. One is to set up a gulp task which appears to do the same thing as <code>webdriver-manager start</code>:</p>
  
  <pre><code>gulp.task('webdriver_standalone', require("gulp-protractor").webdriver_standalone);
  </code></pre>
  
  <p>This <em>works</em>, but not when I have my e2eTest task invoke it as a dependency. I have to run <code>gulp webdriver_standalone</code> in a seperate terminal window.</p>
  
  <p>I cannot understand the other suggested option.</p>
  
  <blockquote>
    <p>point to the selenium jar in the protractor config file</p>
  </blockquote>
  
  <p>These instructions require a path to the <em>selenium-server-standalone jar</em>, in <code>protractor</code>s <code>node_modules</code> (<code>./node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar</code>), but my <code>node_modules/protractor/</code> directory does not have such a jar (or a <code>selenium</code> sub-directory at all)</p>
  
  <p>The instructions for <a href="https://github.com/mllrsohn/gulp-protractor#user-content-running-protractor-without-a-plugin" rel="noreferrer">Running Protractor without a plugin</a> seem to have the same problem of having to run the selenium server in another terminal window.</p>
  
  <p>Is there a way to get this set up so that a single gulp task starts the standalone server, runs the tests, and shuts it down with no other intervention?</p>