Difficulty: intermediate
Estimated Time: 20 minutes
  • Educational Objective
  • What You Need To Know Before You Start
  • Scenario Contents

IMPORTANT: You need to do the steps in sequence in order for the state of the lesson's learning environment to be consistent. Otherwise, you'll get behaviors that might be confusing.


Educational Objective

The objective of this scenario is to show you how to install a special version of Jenkins server that supports using the mabl CLI tool in a Jenkins Pipeline job. Also, the scenario shows you how to create tests in mabl and integrate those tests into the Jenkins Pipeline job.

What You Need To Know Before You Start

In order to get full benefit from the concepts and tasks presented in this scenario you need to have basic understanding of how to enter commands in the Katacoda interactive learning environment. Each step has commands that can be entered into the interactive terminal automatically by clicking on the command.

There is no need to type directly into the terminal window. Clicking on a command will automatically execute it.

Scenario Contents

Step 1 - Installing the mablJenkins server under Docker

Step 2 - Creating an account in mabl

Step 3 - Understanding mabl Tests, Plans, Environments and Deployments

Step 4 - Creating UI Tests using the mabl trainer

Step 5 - Creating the Jenkins Pipeline job for the mabl tests

Step 6 - Creating the Pipeline Script

Step 7 - Running the Jenkins Pipeline Job

You've crossed the finish line!

In this scenario you learned:

  • How to install the mablJenkins server
  • Create UI tests in mabl
  • Create a Jenkins Pipeline job under the mablJenkins server
  • Run the Jenkins Pipeline job
  • Evaluate the results of the Jenkins Pipeline job

Using the mabl CLI Tool To Run UI Tests Within a Jenkins Pipeline Job (Under Construction)

Step 1 of 7

Step 1 - Installing the mablJenkins server under Docker

Objective: The objective of this step is to install a special version of Jenkins that is configured with the mabl CLI tool. The Jenkins server is named, mablJenkins and runs as a container under Docker.

Step 1: Clone the mablJenkins repository code

git clone https://github.com/reselbob/mabljenkins.git

Step 2: Go to the project's directory

cd mabljenkins

Step 3: Build the container image locally.

docker build -t mabljenkins:v1 .

Step 4: Create the container based on the local Docker image, making the host's version of Docker available to the Jenkins container

docker run --name jenkins -d -p 80:8080 -p 50000:50000 -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker mabljenkins:v1

Step 5: Confirm the docker command works from inside the Jenkins container

docker exec -it jenkins docker ps

You'll output that is similar to, but not exactly like the following:

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                       NAMES
177b9fe064b7        mabljenkins:v1      "/sbin/tini -- /usr/…"   24 seconds ago      Up 24 seconds       0.0.0.0:50000->50000/tcp,0.0.0.0:80->8080/tcp   jenkins

Step 6: Get the initial login ID that you'll need to access Jenkins

docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword

You'll output that is similar to, but not exactly like the following:

4b36a89b91a24c51a5d4042433c013e2

SAVE THE LOGIN ID. You're going to need it when you enter the Jenkins server UI for the first time.

Step 7: Bring up the mablJenkins server Web UI

Now that the mablJenkins server is up and running you're going to complete the rest of the scenario by working directly in the Jenkins Web UI.

Click the link below to bring up the Jenkins Web UI within the Katacoda interactive learning environment.

Click here to go to the instance of Jenkins server running undre Katacoda.

You'll be presented with a web page that has a button labeled, Display Port. Click that button which will then shows you Jenkins Getting Start page, as shown below.

Display Port

Next you'll be shown a web page that wants you to enter the Login ID your identified in Step 6, as shown in the figure below. Do so.

Enter Login ID

Then complete the Jenkins initialization process until you arrive at the Jenkins Server Home Page, as shown in the figure below.

Jenkins Web UI

This completes the process of setting up the mablJenkins server. The steps that follow will have you working within the mabl web site to create UI tests. Also, you'll work within this mablJenkins server to setup the Jenkins Pipeline job that will run the tests you create in mabl.