E2E testing with Docker for a typical Front/Back/DB app
This tutorial explores a way to have end to end (e2e) tests executed automatically and easily for a typical webapplication that is split into different modules: frontend + backend + persistence.
E2E testing is always "difficult" since it
- involves using a browser, which usually means restrictions on the running environment (like having a GUI, or windows system, etc)
- requires to have the app running: which could mean running programs (like a backend) and services (like a mongodb) and setting them up.
- involves testing changes to all modules: in a project that is modularized into several parts, e2e are tests that affects all of them.
Sample App
We will use a sample really small app but this should easily scale to a more complex application. The architecture is quite standard:
- frontend: a react/redux app (source code)
- backend: a nodejs app (source code)
- db:: a mongodb
- e2e-tests: a module with e2e tests written in codecept + nightmare (source code)
Here are the stack of technologies

* All icons and names included here are trademark/copyright of their respective organizations/foundations
Proposal
The proposal here involves:
- Using docker and docker-compose to model each modules as an image, and orchestrating containers for running the tests
- Using travis to automatically build and publish docker images as well as running tests (unit tests + e2e)