https://github.com/brainhubeu/cucumber-steps
🥒 Quick start for testing with Cucumber.js
https://github.com/brainhubeu/cucumber-steps
chai cucumber cucumber-framework cucumber-js cucumber-steps cucumber-tests cucumberjs mocha sinon superagent testing-practices testing-tools
Last synced: 15 days ago
JSON representation
🥒 Quick start for testing with Cucumber.js
- Host: GitHub
- URL: https://github.com/brainhubeu/cucumber-steps
- Owner: brainhubeu
- License: mit
- Created: 2017-06-22T13:42:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-05T02:03:50.000Z (22 days ago)
- Last Synced: 2025-04-06T21:09:46.863Z (20 days ago)
- Topics: chai, cucumber, cucumber-framework, cucumber-js, cucumber-steps, cucumber-tests, cucumberjs, mocha, sinon, superagent, testing-practices, testing-tools
- Language: JavaScript
- Homepage: https://brainhub.eu/
- Size: 579 KB
- Stars: 15
- Watchers: 4
- Forks: 6
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cucumber-steps
Quick start for testing with cucumber[](https://circleci.com/gh/brainhubeu/cucumber-steps)
[](https://github.com/brainhubeu/cucumber-steps/commits/master)
[](https://github.com/brainhubeu/cucumber-steps/blob/master/LICENSE)
[](http://makeapullrequest.com)
[](https://renovatebot.com/)[](https://www.npmjs.com/package/@brainhubeu/cucumber-steps)
[](https://github.com/brainhubeu/cucumber-steps/commits/master)
[](https://www.npmjs.com/package/@brainhubeu/cucumber-steps)
[](https://www.npmjs.com/package/@brainhubeu/cucumber-steps)
[](https://github.com/brainhubeu/cucumber-steps/graphs/contributors)# Getting started
Install librarywith npm: `npm i --save-dev @brainhubeu/cucumber-steps`
or with yarn: `yarn add --dev @brainhubeu/cucumber-steps`
Add following in anywhere in your `step-definitions` directory
```js
import { defineSupportCode } from 'cucumber';
import stepsSupport from '@brainhubeu/cucumber-steps';defineSupportCode(stepsSupport);
```
# Available steps
#### Setting headers
```
Given I set header "heder-name" with value "header-value"
```#### Sending request
```
When I send a "METHOD" request to "/path"
```#### Sending request with body
```
When I send a "METHOD" request to "/path" with body:
"""
{
"name": "Wonderful coffee",
"project": {
"name": "Coffee"
}
}
"""
```#### Chcking response code
```
Then the response code should be 111
```#### Checking response body
```
Then the JSON should match pattern
"""
{
"name": "Wonderful coffee",
"project": {
"name": "Coffee"
}
}
"""
```