A containerized platform to run your tests in python headless using firefox
chrome
and phantomjs
. So you can have your tests automated and place it in the docker container from where all the automation tests can be executed. The container would help you simulate all your tests in python without worrying about its packages and dependencies.
Docker
should be installed in the machine.Docker machine
should be up and running.- Docker
ubuntu
image should be present. If it is not present in your machine just do adocker run ubuntu:latest
ordocker pull ubuntu:latest
.
- Get the image into your local machine either from
github
by using the following commandhttps://github.com/Corefinder89/pyconauto.git
or you can clone it fromdockerhub
as well using the following commanddocker pull corefinder/pyconauto
. - Next you need to configure the automation project directory inside the
Python-Automation-Project
directory. - Once the image is present in your local system you need to build the corresponding
Dockerfile
to get the dependencies and packages in your container. The command to build your docker image would bedocker build -t <tagname_image> corefinder/pyconauto .
. - Last but not the least you need to execute the docker container to execute all your tests using the command
docker run --name <container name> corefinder/pyconauto
.
I have written a small python automation code which is added to the Python-Automation-Project directory. You can build the corresponding dockerfile and execute it to understand the flow and then get started with your automation. By default I am executing the test in Firefox using the fecko driver. The selenium version installed is the latest version - 3.3.3, so geckodriver and chromedriver has to be configure seperately.
Please give a thumbs up if the module helps you out in running your selenium tests on docker seamlessly. Please leave your comment as a feedback, so that I can fine tune the container module as per requirements.