Common test steps for testing api's.
npm install minosseCommon steps for testing api's using Cucumber.js.
npm install minosse --save-dev
`
Create a steps file in your project and load the api teststeps from there and add an optional configuration:
`js
module.exports = function myCustomSteps() {
require('minosse').call(this);
this.setTestConfig({
defaultHost: 'localhost',
defaultPort: 8080
});
}
`
Use the steps in your feature file:
`cucumber
Given I set property request body to number-array 1,2,3
When I send a POST request to /sum
Then the response status code is 200
And I check property sum of response body equals number 6
`$3
- Check out which test steps you can use
- Save the log output of the steps
- Create custom stepsDevelopment
$3
We have an .editorconfig file to help us having a consistent coding style.
Please install a plugin for your editor.We use
eslint for code linting.
There are plugins for that too.$3
We use gulp as a task runner. Install it globally first: npm install -g gulp.
To see a list of gulp commands, run: gulp help
$3
In the package.json you can see a pre-commit and pre-push hook.
On commiting or pushing these commands are executed.
If they fail, the commit/push will fail.
Add the --no-verify` flag to your commit or push to bypass these checks.