Skip to content

Instantly share code, notes, and snippets.

@roundand
Last active December 4, 2018 12:31
Show Gist options
  • Save roundand/cccd7acffac02578b2eb374656d449fe to your computer and use it in GitHub Desktop.
Save roundand/cccd7acffac02578b2eb374656d449fe to your computer and use it in GitHub Desktop.
Doing a command-line demo of the karate API test framework using pre-compiled JARs

Not interested in this as Java, so followed isntruction in https://github.com/intuit/karate/blob/master/karate-netty/README.md

  • Ensure Java installed
  • Download karate jar file as described, and rename to karate.jar
  • Download following files into the same directory:
    • cats-mock.fearure
    • cats-test.feature
    • cats.html
  • Open console in directory, and start server with java -jar karate.jar -m cats-mock.feature -p 8080 &
  • Open cats.html as a file link in a web browser, and experiment
  • Edit test to run without config
Background:
    #* def starter = read('start-mock.js')
    * def port = 8080
    * url 'http://localhost:' + port + '/cats'
  • from same console, run tests with java -jar karate.jar -m cats-mock.feature -p 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment