Test automation is the secret to DevOps success and is essential in the world of Continuous Deployment and short deployment cycles. To achieve high speed and agility, it is important to automate our testing processes and configure them to run automatically to get automated feedback on each code commit. With TestProject you can easily integrate into your CI/CD workflow with their rich API swagger and the most popular DevOps tools, including Jenkins, Azure DevOps, and Docker! 🐳🚀
In this tutorial, we are going to focus on Docker: What is Docker, how do we set up a Docker environment, and how can we benefit from TestProject Agents in Docker containers? And more! Let’s get started with this ultimate Docker tutorial to accelerate your automation testing! 🐳👉
Table of Contents
- You’re here → Introduction to Docker & Docker Desktop
- Introduction to TestProject and TestProject Agent in Docker
- Running TestProject Agent inside Docker Container
- Why Do I Need TestProject Agents Running Inside Docker Containers?
- Setting up TestProject Agent in Docker
- TestProject in Docker Reports and Dashboards
- Conclusion
- [Webinar Recording] Accelerate Your Test Automation using TestProject & Docker
Introduction to Docker & Docker Desktop
Why Docker?
Gone are the days when applications & their dependencies needed to be set up on different physical systems for developing, testing & making them available for the end users. The introduction of virtualizing hardware inside the same system broke away these constraints that had yet locked us in. But that too came at a price & many resources left untouched finally gave in to the concept of containerization.
In layman’s terms it’s simply the process of packing the software & its dependencies so the application runs quickly and reliably from one computing environment to another for Development, Shipment and Deployment.
Build, Ship & Share
Docker is the de facto standard to build, run and share containerized apps – From desktop, to the cloud. Docker uses a client-server architecture in the following way:
- The Docker client talks to the Docker daemon, which does the heavy lifting of building, running, and distributing your Docker containers.
- The Docker client and daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon.
- The Docker client and daemon communicate using a REST API, over UNIX sockets or a network interface.
Docker Objects
When you use Docker, you are creating and using images, containers, networks, volumes, plugins, and other objects. This section is a brief overview of some of those objects:
- Images: An image is a read-only template with instructions for creating a Docker container. You can create your own image, using a Dockerfile with a simple syntax for defining the steps needed to create the image and run it, or build an image based on another image, with some additional customization.
- Containers: A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. You can connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.
- Services: Services allow you to scale containers across multiple Docker daemons, which all work together as a swarm with multiple managers and workers.
Docker Hub
A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker is configured to look for images on Docker Hub by default. You can even run your own private registry.
Docker Compose
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. Compose is great for development, testing, and staging environments, as well as CI workflows. We will be leveraging Docker Compose towards the end of this tutorial where we will be starting a TestProject agent with headless Chrome and Firefox browsers.
Setting up a Docker Environment
Follow the instructions appropriate for your operating system to download and install Docker Desktop:
- Docker Desktop for Mac: https://docs.docker.com/docker-for-mac/install/
- Docker Desktop for Windows: https://docs.docker.com/docker-for-windows/install/
- Docker For Ubuntu: https://docs.docker.com/engine/install/ubuntu/
After you’ve successfully installed Docker Desktop, you can verify the Docker version by clicking on whale-icon on the top left of the screen and selecting “About Docker Desktop”.
Open a terminal and run docker –version to check the version of Docker installed on your machine.
- $ docker version
Test that your installation works by running the hello-world Docker image:
- $ docker run hello-world
Now we are all set and familiar with Docker! Next up, we will learn where TestProject comes into the picture, what are the benefits to having TestProject Agents running inside Docker containers and how to set it up!
👉🐳 Go ahead to the next chapter!