compare rendered web page elements
1.2K
Regression testing for frontend developement
You have a development web server running on your computer - perhaps in a virtual machine or another docker.
You want to make sure that only the layouts / elements change you expect to change.
You want to keep track of responsiveness.
This should be available with easy to use config files.
You are styling a block on a web page. You have a layout to improve and want to check the progress.
You want to see the changes compared to a previous version.
You want to check different screen widths.
You get a web ui to start the grabbing and show the results.
Differences between the old and new layout are highlighted, mouse moves should change the opacity.
Other page elements should not change, you are informed if they do.
The configuration file defines urls, viewport widths and page elements and how to compare them.
Build the docker image with:
$ docker build -t uwegerdes/compare-layouts .
For the development time a gulpfile.js is included to generate css from less and restart the server.
$ docker run -it \
-v $(pwd):/home/node/app \
--name compare-layouts-dev \
uwegerdes/compare-layouts \
bash
Run gulp or npm test in the container.
To restart the container use:
$ docker start -ai compare-layouts-dev
Start the docker container in your project test directory (with tests/compare-layouts directory):
$ docker run -d \
-v $(pwd)/modules:/home/node/app/config/modules \
--name compare-layouts \
uwegerdes/compare-layouts
The container starts in background, you might want to use some of these commands:
$ docker exec -it compare-layouts bash
$ docker logs -f compare-layouts
To restart the container use:
$ docker start -ai compare-layouts
Open the server address listed in the output. Read content.
To use a virtual hostname with ip in the config file you should map it to the container with --add-host apphostname:192.168.1.10. Perhaps allow firewall rule for docker ip network.
You may experience different behaviour if the result subdirectories are created:
Just restart gulp to have the full experience.
Start the docker container in directory with a ./results/ directory:
$ docker run -it --rm \
-v $(pwd)/results:/home/node/app/results \
uwegerdes/compare-layouts \
npm test
You will find a lot of files (the cache for the server app) in a subdirectory of ./results/.
0.5.4: use firefox-esr and slimerjs v0.10
0.5.3: bug fixing, better logging, integration in other project
0.5.2: refactoring
Content type
Image
Digest
Size
418.4 MB
Last updated
over 6 years ago
docker pull uwegerdes/compare-layouts