Please pull the following Docker images (by executing the commands shown below):
docker pull ubuntu:18.04
docker pull nginx
docker pull node:10
docker pull selenium/node-chrome-debug
docker pull selenium/node-firefox-debug
docker pull selenium/hub
docker pull maven:3.6.1-jdk-8
docker pull ruby:2.6.3
A good text editor (Code, Eclipse or IntelliJ), and a GitHub account
- What is Selenium
- Selenium WebDriver Flow
- To use ChromeDriver to navigate and search for an element (Exercise).
- ChromeDriver installed
Selenium automates browsers. Describes the user interaction with a web application, emulates what a user would do.
WebDriver is just an API.
ChromeDriver is an open source tool and provides capabilities for navigating to web pages, user input, JavaScript execution, and more.
- What is Docker
- Why do we use containers
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
A container is a standardized unit of software.
What happens in the container does not affect the host.
The names of the containers are generated with a random pronoun and a random name.
- Running a container
- Running a container in the background
- Stopping a container
- Useful Docker commands
- Volumes advantages
- Creating a Volume (Exercise)
Volumes are used for sharing.
- Sharing a directory between multiple containers.
- Sharing a directory between the host and a container.
- Sharing a single file between the host and a container.
- What is an Image
- Useful Image commands
- Building an Image manually and tagging it (Exercise)
Images are like templates.
An image is the union of files and metadata
There are two ways of creating an image: Manual and Automated (preferred one - Dockerfiles)
- What is a Dockerfile
- Creating a Dockerfile and building an image (Exercise)
- Caching builds
- Tips for good Dockerfiles
A Dockerfile is a set of instructions to build a Docker image.
It tells Docker how an image is constructed.
- Dockerizing a Web App with a basic Dockerfile (Exercise)
- Creating a network (Exercise)
- Adding containers to a network (Exercise)
- Why Selenium Grid
- Start a grid on Standalone mode (Exercise)
- Running a simple test (Exercise)
- Grid with Hub and Nodes (Exercise)
Selenium Grid allows you run your tests on different machines against different browsers in parallel.
A grid consists of a single hub, and one or more nodes.
Selenium Hub is the intermediary. Take instructions from the client and executes them remotely on nodes.
Selenium Node does not evaluate, make judgments, or control anything: it only receives and executes instructions (and throws exceptions).
To a start a Grid in Standalone Mode we need to have Java installed.
This is how people were doing it some years ago when Docker wasn’t that popular. This is not the ideal workaround.
To reduce the amount of work -> Docker containers. Problem: it is not easy to provide containers for IE or Safari -> Open Source projects (Docker container, Selenoid, Zalenium).
The main requirement to have a grid with a hub and nodes is that all of them are connected and able to communicate.
- What is Docker Compose
- Starting a Selenium Grid via Docker Compose (Exercise)
Docker Compose is a tool for defining and running multi-container Docker applications.
With Docker 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.
Docker Compose is great to avoid having many manual terminal commands to start all our containers.
Docker Compose puts all the running containers in the same network
If Starting a Selenium Grid via Docker compose fails it could because the hub was not completely up and nodes try to register in something that is not running. It will be solved in next exercise.
- Stopping the containers
- Docker Compose Project Name
- Docker Compose commands
- Docker Compose Build (Exercise)
- How do we add the Ruby container to the Docker Compose file? (Exercise)
With Docker Compose Build we will build and image from a Dockerfile.
We will add the Ruby Container to the composer file in order to run a test.
With this approach, the test will fail because the hub is not ready, the container is started but the service is not up and ready to receive connections.
- Waiting for the container (Exercise)
- Configuration Options and Scenarios
- Scaling up a Selenium Grid to run tests in parallel (Exercise)
- sample-node-app.zip
- sample-node-app__environment.zip
- link-follower.zip
- Creating a GitHub repository with Travis integration.
- GitHub Account
- sample-node-app__ci.zip