docksal/backstopjs

Sponsored OSS

By docksal

Updated almost 9 years ago

A self-contained Docker image to run BackstopJS with no external dependencies

Image
Integration & delivery
Web servers
Monitoring & observability
2

10K+

docksal/backstopjs repository overview

BackstopJS Docker Image

A self-contained Docker image to run BackstopJS with no external dependencies.

Features:

Versions

  • docksal/backstopjs:2 - BackstopJS 2.x (legacy)
  • docksal/backstopjs (docksal/backstopjs:3) - BackstopJS 3 with Chrome Headless support

Usage

Use this image as if you were using a binary.
Working directory is expected to be mounted at /src in the container.

$ docker run --rm -v $(pwd):/src docksal/backstopjs --version
BackstopJS v3.0.25
BackstopJS 3.0.25

You can also add a shell alias (in .bashrc, .zshrc, etc.) for convenience.

alias backstop='docker run --rm -v $(pwd):/src docksal/backstopjs "$@"'

Restart your shell or open a new one, then

$ backstopjs --version
BackstopJS v3.0.25
BackstopJS 3.0.25

Sample test

BackstopJS 2.x

docker run --rm -v $(pwd):/src docksal/backstopjs genConfig
docker run --rm -v $(pwd):/src docksal/backstopjs reference
docker run --rm -v $(pwd):/src docksal/backstopjs test

BackstopJS 3.x

docker run --rm -v $(pwd):/src docksal/backstopjs init
docker run --rm -v $(pwd):/src docksal/backstopjs test
docker run --rm -v $(pwd):/src docksal/backstopjs approve
docker run --rm -v $(pwd):/src docksal/backstopjs test

Browser engines

By default BackstopJS is using Chrome Headless to take screenshots.
You can also use PhantomJS or SlimerJS/Firefox by setting "engine": "phantomjs" or "engine": "slimerjs" respectively in backstop.json.

PhantomJS, SlimerJS and Firefox ESR (extended support release) are pre-installed in the container.

Limitations

backstop openReport is not (yet) supported.
You will need a running webserver to view HTML reports generated by BackstopJS.

When running SlimerJS, the user you are running the container as must have a home directory in order for Slimer to start properly. You can work around this by setting the HOME variable. Ex:

docker run --rm --user 1000 -e HOME=/tmp/home docksal/backstopjs test

Debugging

The following command will start a bash session in the container.

docker run --rm -v $(pwd):/src -it --entrypoint=bash docksal/backstopjs

Tag summary

Content type

Image

Digest

Size

289 MB

Last updated

almost 9 years ago

docker pull docksal/backstopjs

This week's pulls

Pulls:

899

Last week