A javascript framework consisted of mocha, chai and chai-http.
Using gulp to be able to change environment, run all tests, specific tests or specific testsuite with parameters on the command line which suites a jenkins setup well.
- nodejs installed: https://nodejs.org/en/download/
git clone https://github.com/weaddquality/javascript-api-testing.gitnpm install
- run all tests:
gulp test-api --env <environmentName> - run a testsuite:
gulp test-api --env <environmentName> --spec <suiteFolder>/*.test.js - run a specific test:
gulp test-api --env <environmentName> --spec <suiteFolder>/<yourTest>.test.js
- Install the Git Plugin in Jenkins Plugin Manager
- Install the AnsiColor Plugin in Jenkins Plugin Manager
- Create a freestyle job
- Add your git-repository in SCM
- Activate Color ANSI Console Output with CSS in Build Environment
- Add two buildsteps with
execute shellfor linux orwindows batch commandfor windows in Build - Type
npm installin the shell/batch of the first step - Type
node_modules\.bin\gulp test-api --env <yourEnvironment>in the shell/batch of the second step
