-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Get Started: JetBrains IntelliJ
The official Karate plugins work for both IntelliJ IDEA and the Community Edition. They can be downloaded from here: https://www.jetbrains.com/idea/download
From within the IDE, go to the Settings
dialog (typically accessible via File -> Settings -> Plugins
) and select Plugins
on the left. Type karate
into the search field (for the Marketplace
) as shown below.
![image](https://user-images.githubusercontent.com/915480/231367398-5e5a9c9f-4905-422c-887c-21778019fa94.png)
Click on the Install
button. After the install you may be asked to restart IntelliJ.
When you open IntelliJ you should see a dialog where you can create a New Project
like this (when Projects
is selected on the left).
If you are new to Karate, you can use the Karate Maven archetype to create a simple starter project.
After you click New Project
you can choose Maven Archetype
as the "Generator" on the left.
For "Catalog" choose Maven Central
. Then type com.intuit.karate:karate-archetype
into the Archetype
field.
You should see something like this below. Here we are using Karate version 1.4.0 - but you can use the latest version as per the documentation.
![image](https://user-images.githubusercontent.com/915480/231372378-7cdf9c5d-ae17-4e91-a1ee-d696ab615d1d.png)
Now click the Create
button and once done, you should have a valid Karate Maven / Java project ready. Here below, we have opened the sample users.feature
.
![image](https://user-images.githubusercontent.com/915480/231373110-5b2c8310-79b3-40c2-aa50-894760e14378.png)
- If you have Maven installed, you can follow these instructions and then open the project in IntelliJ.
- If you have Git installed, you can clone this karate-template project or the sample karate-test project. You can even choose the
Get From VCS
option after you open IntelliJ and type in the Git URL as shown below.
![image](https://user-images.githubusercontent.com/915480/231377758-127c83dd-02ec-4860-97b9-cec09e0cfe0f.png)
Click on the >>
icon in the code-editor (on the same line where Feature:
appears) and you will see an option to Run
the file.
![image](https://user-images.githubusercontent.com/915480/231373427-ca6fc61c-93ed-4fba-b011-8d03e05431b1.png)
After running a test, you will see the test results window in your IDE. If you scroll all the way down on the console (button highlighted in red), you will see a link to open the HTML report.