Running Protractor tests in docker through teamcity
I have been able to figure out how to get everything to work.

Let's start from the beginning:

Changes to config file


Remove the selenium server settings (the docker container starts one on every run, and uses that automatically)
Add 'useAllAngular2AppRoots' otherwise the tests will all fail


The resulting config file will be something like this (ignore the params section, that is just an object with additional parameters you can inject into your tests):

// conf.js
var spec_files = "tests/*.specs.js";
exports.config = {
  framework: 'jasmine',
  specs: [spec_files],
  useAllAngular2AppRoots: true,
  multiCapabilities: [{
    browserName: 'chrome'
  }],
  restartBrowserBetweenTests: true,
  params: {
    sleepTime: 0
  }
}


Setting up the build step in teamcity

Usually when I want to run a build step I do it in a docker container, and execute command line steps inside that container.

To get this to run I could not do this, as we need to inject a few parameters at the end of the run command, so you need to create a docker command, looking like this: