Search This Blog

Breaking

Thursday, 29 April 2021

[Karate API Automation Framework] How to setup project from scratch in Intelij?



Pre-requisite:

  1. Java 1.8 
  2. Maven
  3. IntelliJ or Eclipse
       Karate Version:  0.9.6


       Steps to follow:

  1. Open your IDE. Create a new Maven Project by following the below path->

File- > New-> Project or New Project from launch page




2.    Select “Create from ArcheType” check box and click on “Add Archetype”

Archetype Details: https://mvnrepository.com/artifact/com.intuit.karate/karate-archetype/0.9.6





3.  Fill in below details and click on Ok.

      GroupId: com.intuit.karate

      ArtifactID: karate-archetype

      Version: 0.9.6



        4. You will see karate-archetype added to the list. Select it and click on Next.

       


      5. Give Your project a Name and Location (Or keep it default) and click on Next.





6. Click on Finish and select the window.



7. Let the build run and install all the necessary files.


8. It will set up the default project for you.




9. Now run the default created scenario from the feature file.



10. 
Run it with the help of Junit class.



11. 
Run All scenarios irrespective of tags.



Reference Links:

1. https://mvnrepository.com/artifact/com.intuit.karate/karate-archetype : Karate archetype/ maven repo link

2. https://github.com/intuit/karate : Documentation Link

3. https://www.youtube.com/watch?v=W-af7Cd8cMc -> How to configure Karate


Common Issues:


1. If first time creating any BDD project (feature file), then need to install “cucumber for java” and “Gherkin” plugin. (By default, Gherkin installs with cucumber for java)



    How to Install Plugin explicitly:

  1. https://www.jetbrains.com/help/idea/managing-plugins.html


   2.   While installing gherkin, cucumber for java, installed substep definition plugin also. Because of this, feature files are not running.

Expected: We don’t need to install the substep definition plugin at all.





No comments:

Post a Comment