Jenkins with Apache Maven for Continuous Integration

What is Jenkins from wiki perspective?

Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle.Jenkins provides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat.

We are going to utilize Jenkins for managing the continuous integration testing for our mobile application automation. Jenkins will use the POM.XML file created by using the Apache Maven project, which was explained in the below thread;

https://gopekannan.wordpress.com/2015/09/22/how-to-integrate-apache-maven-with-appium-java-and-junit-in-eclipse-ide/

There are lot of options available in the Jenkins to run our test build on periodic manner or after the new snapshot has been generated etc,.

Let us start our session by downloading the Jenkins installer from the below URL and install the same in your windows x86 or x64 PC. Please note Jenkins will work in the 32-bit processing mode in which even though you are using 64 bit machine, it will be installing in the C:\Program Files (x86) folder.

https://jenkins-ci.org/

Download the Apache Maven installer from the below URL and install the same in your PC;

https://maven.apache.org/download.cgi

Just check whether Jenkins is getting installed and working as expected by verifying its dashboard using the below URL;

http://localhost:8080

Once dashboard is visualized with various option in the left pane, please select the Manage Jenkins option based on the below screenshot;

Manage Jenkins

Select the Configure System option in right pane and Configure the JDK installation and Maven installation URL based on the below screenshot;

JDK configuration

Maven Configuration

Click Save button and proceed for build configuration process.

Click the New Item option in the left pane and again select the Maven Project checkbox in the right pane. Enter the item name on your own and I entered as AppiumTest here.

New Item

Click the OK button.

Newly created item will be displayed in the dashboard as stated below;

Dashboard

Select the newly created item in the right pane, which is nothing but AppiumTest.

Select the Configure option in the left pane.

Enter the Project Name and its description.

Under the Build option in the right pane, map the POM.XML location as specified in the below screenshot;

Configure

Click the Save button.

Now click the Build Now option in the left pane, Jenkins automatically fetch the configured Apache Maven POM.XML from the respective location and start executing the test scripts once the Appium Server and Android Emulator UP.

That’s it Jenkins integration completed and start analyzing the test results once test run completed in the respective Android emulator or real devices via Appium Server.

Build In Progress

Build in progress

Console Logs

Console

Once the test run completed and it will log the test results based on the below screenshot;

TestResults

Timeline and Trend

Timeline and Trend

Build History

Build History

Please refer the below screenshot to run our test build on periodic manner;

Build Periodically

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s