JBang is a good option for teams that don't want to install Java or an IDE or worry about compiling code. This simple example uses the Java Faker library to generate a user name and then make an API call.
- karate.java - this sets up Karate and adds the Java Faker dependency to the classpath
- test.feature - a simple test that uses the Java Faker Java API to generate a person name
With JBang installed, this command will run the tests. You can replace .
with any valid path that contains *.feature
files.
jbang karate.java .
- Other Runtime Options
- Karate, JBang and NPM - for those who want to use 3rd party Java libraries or custom code and avoid Java compilation and Maven