title: Running nodeJS app, selenium and webdriver.io tests in docker container
body: <p>I am trying to do some webdriver.io tests with my node application, which is a docker image.</p>
  
  <p>So what I did so far is:</p>
  
  <p>1) Get <em>selenium server</em> by running this on my ubuntu server:</p>
  
  <pre><code>$ docker run -p 4444:4444 selenium/standalone-chrome
  </code></pre>
  
  <p>This gives me the running container 'ubuntu_selenium_1' (<code>$ docker ps</code>)</p>
  
  <p>2) Build <em>node application</em> docker image, running node application in background and running e2e.js test file</p>
  
  <p>In my gitlab-ci.yml I am doing</p>
  
  <pre><code>- docker build -t core:test -f Dockerfile.testing .
  - docker run --rm core:test
  </code></pre>
  
  <p>That doesn't give me any output. No expected title and no error message.</p>
  
  <p>So what am I doing wrong? There is a running selenium server, there is the node application which is loaded in background and the e2e.js test file is started.</p>
  
  <p>I'm missing the connection of nodeJS app, webdriver and selenium...</p>
  
  <p><strong>Dockerfile.testing</strong></p>
  
  <pre><code>FROM core:latest
  
  # Copy the test files
  COPY docker-entrypoint.sh /
  COPY e2e.js /
  
  # Get npm packages AND install test framework - mocha and webdriver
  RUN (cd programs/server &amp;&amp; npm install --silent)
  RUN npm install -g mocha --silent
  RUN npm install chai webdriverio --silent
  RUN chmod +x /docker-entrypoint.sh
  
  # Run application and then e2e test
  ENTRYPOINT ["/docker-entrypoint.sh"]
  </code></pre>
  
  <p><strong>docker-entrypoint.sh</strong></p>
  
  <pre><code>#!/bin/bash
  node main.js &amp; node e2e.js
  </code></pre>
  
  <p>Maybe this entrypoint script is wrong??</p>
  
  <p><strong>e2e.js</strong></p>
  
  <pre><code>var     webdriverio = require('webdriverio'),
          options = {
              desiredCapabilities: {
                  browserName: 'firefox'
              }
          }
  
  webdriverio
      .remote(options)
      .init()
      .url('http://localhost') // Which port do I have to use??
      .getTitle().then(function(title) {
          console.log('Title was: ' + title)
      })
      .end()
  </code></pre>