Reputation: 33
I am unable to run the karate tests in my feature
package api;
import com.intuit.karate.junit4.Karate;
import org.junit.runner.RunWith;
@RunWith(Karate.class)
public class PagesRunner {
}
this is the report which gets generated
My Feature file:
Feature: some Adaptor Request Success
Background:
* def myUrl = baseURL
* configure headers = read('classpath:some-headers.js')
Scenario: Some Adaptor Success
* def someInitiate= read('classpath:requests/someRequest.json')
* url myUrl
Given path 'api/somerequest'
And request someInitiate
When method post
Then status 202
Not sure what I am missing here. Very new to api automation world. Any help is much appreciated.
Upvotes: 1
Views: 3981
Reputation: 1
This resolved my problem:
<testResources>
<testResource>
<directory>src/test/java</directory>
<excludes>
<exclude>**/*java</exclude>
</excludes>
</testResource>
</testResources>
</build>
Upvotes: 0
Reputation: 58088
May I suggest you follow the quick-start example to get started.
https://github.com/intuit/karate#quickstart
mvn archetype:generate \
-DarchetypeGroupId=com.intuit.karate \
-DarchetypeArtifactId=karate-archetype \
-DarchetypeVersion=0.8.0 \
-DgroupId=com.mycompany \
-DartifactId=myproject
Then try to run the UsersRunner.java
| users.feature
without issues. Then you can build on that.
Upvotes: 1