Karate integration with Jenkins
Whatever project we are working on, over a period of time we end up having a large suite of tests that need to be run very often. To have tests running regularly, it is key that we integrate test suite execution with our Continuous Integration tool chain.

If you are new to API testing with karate you can go through my previous post-Kick-off web services testing with Karate. That will be sufficient to get you started with karate.

In this post, I will walk you through karate -Jenkins integration in few easy steps.

I. Install Maven in Jenkins

Go to Jenkins Dashboard ->Manage Jenkins ->Manage plugins ->Available ->Maven Integration plugin ->Install

2. Go to Jenkins Dashboard -> New Item -> Maven Project option will be available

II. Create a Maven project

Go to Jenkins Dashboard -> New Item -> Choose name for the Maven Project (e.g. KarateMavenExample)

III. Configure Maven project

In Configure Page, do the following changes

1. Discard Old builds

-Days to keep builds: 7

-Max no. of builds to keep: 15

2. Build -> advanced -> enable the following

-Resolve Dependencies during Pom parsing

-Use custom workspace (add path of the folder containing pom.xml)

-Goals & Options = Clean test

If you have different environments configured in karate-config.js, you can use the “Goals & Options” to choose the environment you want to run in.

e.g : test -DargLine="-Dkarate.env=UAT"

3. Apply & Save

IV. Go to Project Window and Click ‘Build Now’.

Go to ‘Console Output’ and now you can see the test results.

Follow us on Twitter 🐦 and Facebook 👥 and join our Facebook Group 💬.

To join our community Slack 🗣️ and read our weekly Faun topics 🗞️, click here⬇
['Niron Rasanjana']
['Jenkins', 'Api Testing', 'Continuous Integration', 'Test Automation', 'Karate']