Run e2e tests with wdio and selenium-standalone in Docker containers.
Sample of project running E2E tests with
wdio
andselenium-standalone
each existing in separate Docker instances.
See selenium-standalone
Docker instance declaration
Ubuntu.dockerfile.
Run
git clone git@github.com:serbanghita/webdriverio-docker.git
cd my-wdio
docker-compose up
(-d --build --force-recreate
)docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------
my-wdio_seleniumapp_1 npm run selenium Up 0.0.0.0:4444->4444/tcp
my-wdio_testapp_1 tail -f /dev/null Up
docker exec my-wdio_testapp_1 npm run test
- You should see tests passWiki
Using docker
CLI command
docker network create --driver bridge testing-lan
docker run -d -p 4444:4444 --net testing-lan --rm --name seleniumapp serbanghita/selenium-standalone
docker build -t serbanghita/my-wdio .
docker run -d --net testing-lan --rm --name myapp serbanghita/my-wdio
docker exec myapp npm test
Using docker-composer
CLI command
docker-compose up -d --build --force-recreate
docker-compose stop
docker-compose down && docker-compose pull