Sign inSign up

flexys/docker-protractor

By flexys

•Updated about 7 years ago

docker image to test using protractor, chrome & firefox

Image
1

10K+

flexys/docker-protractor repository overview

⁠Dockerfile for Protractor⁠ test execution

Based on caltha/protractor⁠, this image contains a fully configured environment for running Protractor tests under the Chromium browser.

This version additionally supports linking docker containers together to test software in another container, and passing a custom base URL into your protractor specs so you don't have to hard-code the URL in them.

⁠Installed software

  • [locales][http://jaredmarkell.com/docker-and-locales/⁠] This image is configures to en_GB as this is where we test.
  • Xvfb⁠ The headless X server, for running browsers inside Docker
  • node.js⁠ The runtime platform for running JavaScript on the server side, including Protractor tests
  • npm⁠ Node.js package manager used to install Protractor and any specific node.js modules the tests may need
  • Selenium webdriver⁠ Browser instrumentation agent used by Protractor to execute the tests
  • OpenJDK 8 JRE⁠ Needed by Selenium
  • Chromium⁠ The OSS core part of Google Chrome browser
  • Firefox⁠ Firefox browser
  • Protractor⁠ An end-to-end test framework for web applications
  • Supervisor⁠ Process controll system used to manage Xvfb and Selenium background processes needed by Protractor

⁠Running

I have stripped out the automatic running of protractor as we inject the tests through Concourse⁠

When inside the container you can run the tests at the console by simply invoking protractor. When you are done, you terminate the Protractor container with docker kill $CONTAINER.

Your protractor.conf.js must specify the no-sandbox option for Chrome to cleanly run inside Docker. A minimal example config would be:

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  framework: "jasmine2",
  specs: ['*.spec.js'],
  // Chrome is not allowed to create a SUID sandbox when running inside Docker  
  capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      'args': ['no-sandbox']
    }
  }
};

Tag summary

Content type

Image

Digest

Size

629.3 MB

Last updated

about 7 years ago

docker pull flexys/docker-protractor