Starter project created live on Twitch.tv/CharlyAutomatiza based on Karate DSL for NodeJS/NPM Projects
Esta documentación está dispobible también en Castellano.
- Install a git client such as git bash
Download and install
- Latest version of Node.js
git clone https://github.com/charlyautomatiza/starter-karate-dsl-npm.git
npm install
npm run test ./src/features
WARNING: If you have errors please check Known Issues section and then re-try.
To run a specific API Rest test, for example the feature users.feature those cases with the @create_user tag.
npm run test -- ./src/features "--t @create_user"
To execute a specific test of the GraphQL API, for example in feature users-gql.feature those cases with the tag @graphql_examples.
npm run test -- ./src/features "-t @graphql_examples"
Another option:
npm run test:gql
To run all the API Rest and GraphQL tests, it can be run with the @run tag.
npm run test -- ./src/features "-t @run"
Another option:
npm run test:run
Running with N threads
in parallel the cases that have the @run
tag can be done with the -T N
parameter.
With the -C
parameter the target
folder is removed and created again with the new test results.
npm run test -- ./src/features "-t @run" "-T 5" "-C"
npm run test:parallel
After each execution, the reports in html format are generated in the target/karate-reports folder.
For more details you can consult the official documentation
New folder .github/workflows with file karate-test-runner.yml to run our tests from a Github Actions pipeline.
JUnit Report retrieved from GitHub Marketplace
The workflow is configured to run on the following event:
- push: when a repository is pushed.
- Pull request: when a pull request is created.
Users on Windows have reported issues such as the npm install
failing to complete and without any errors shown.
As a workaround, please install JBang manually and re-try the npm install
step.