Sign inSign up

iterativee/headless-protractor

By iterativee

•Updated almost 6 years ago

Image allowing to run protractor tests in headless mode using included chrome nad firefox.

Image
0

2.6K

iterativee/headless-protractor repository overview

This repo is mostly just a fork of: https://bitbucket.org/rkrzewski/dockerfile/src/master/protractor/⁠

⁠Dockerfile for Protractor⁠ test execution

This image contains a fully configured environment for running Protractor tests under Chromium and Firefox browsers.

⁠Installed software

  • Xvfb⁠ The headless X server, for running browsers inside Docker
  • node.js⁠ 8.11 The runtime platform for running JavaScript on the server side, including Protractor tests
  • npm⁠ 5.8 Node.js package manager used to install Protractor and any specific node.js modules the tests may need
  • Selenium webdriver⁠ 12.0 Browser instrumentation agent used by Protractor to execute the tests
  • Java 8 SE⁠ 8u162 Needed by Selenium
  • Google Chrome⁠ Google Chrome browser
  • Firefox⁠ 59.0 Firefox browser
  • Protractor⁠ 5.3 An end-to-end test framework for web applications
  • FFmpeg⁠ useful for capturing screencasts⁠ of the tests
  • Supervisor⁠ Process controll system used to manage Xvfb and Selenium background processes needed by Protractor

⁠Running

In order to run tests from a CI system, execute the following:

docker run --rm -v <test project location>:/project -e "PRT_CFG=tstenv-protractor.conf.js" iterativee/headless-protractor

or in case we just want to run default protractor.conf.js, do:

docker run --rm -v <test project location>:/project  iterativee/headless-protractor

The container will terminate automatically after the tests are completed. The output of supervisord visible on the console is not interesting in most circumstances. You should check target/supervsor.out file to see the output of Protractor. Dispalying the file in an Unix terminal using cat is recommended over opening it using an editor because the file contains ANSI escape sequences.

If you want to run the tests interactively you can launch the container and enter into it:

CONTAINER=$(docker run -d -v <test project location>:/project --env MANUAL=yes iterativee/headless-protractor)
docker exec -ti $CONTAINER sudo -i -u node bash

When inside the container you can run the tests at the console by simply invoking protractor or protractor CFG_NAME. When things don't work as expected, you should check Selenium WebDrover output in /var/log/supervisor/webdriver-err.log. When you are done, you terminate the Protractor container with docker kill $CONTAINER

Tag summary

Content type

Image

Digest

Size

564 MB

Last updated

almost 6 years ago

docker pull iterativee/headless-protractor