Running and debugging tests in a Docker container Running and debugging tests in a Docker container docker docker

Running and debugging tests in a Docker container


I'm not aware of Protractor and it's workflow, but if you need a browser inside a container, did you see this article? I'll take the liberty for quoting this:

$ docker run -it \    --net host \ # may as well YOLO    --cpuset 0 \ # control the cpu    --memory 512mb \ # max memory it can use    -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket    -e DISPLAY=unix$DISPLAY \ # pass the display    -v $HOME/Downloads:/root/Downloads \ # optional, but nice    -v $HOME/.config/google-chrome/:/data \ # if you want to save state    -v /dev/snd:/dev/snd --privileged \ # so we have sound    --name chrome \    jess/chrome


To dockerize your protractor test cases use either of this images from Dockerhub caltha/protractor (or) webnicer/protractor-headless.

Then run this command "docker run -it {imageid} protractor.conf.js". See the instructions in those repositories