@dev-blinq/cucumber-js
v1.0.91
Published
The official JavaScript implementation of Cucumber.
Downloads
4,274
Readme
We took the regular old Cucumber (A tool for running automated tests) and made improvements that could be helpful when working with data that should be saved or when we want to generate fake data for testing purposes in our Gherkin feature file.
Install
@dev-blinq/cucumber-js is available on npm:
$ npm install @dev-blinq/cucumber-js
Get Started
Before, we used to write Gherkin feature files like this -
Feature: Github
Scenario Outline: Create a new repository
Given Create a new repository name "<repo>"
Examples:
| repo
| random_repo_name
Now, instead of picking a random name by ourselfs, we could fake data using the faker library and get a random value -
Feature: Github
Scenario Outline: Create a new repository
Given Create a new repository name "<repo>"
Examples:
| repo
| {{string.alpha(10)}}
We could also save our fake data (or any data really) as a variable for future use using the equals (=) sign -
Feature: Github
Scenario Outline: Create a new repository
Given Create a new repository name "<repo>"
Examples:
| repo
| {{repo=string.alpha(10)}}
Scenario Outline: Create a second repository
Given Create a new repository with the same name as before "<repo>"
Examples:
| repo
| {{repo}}
In that example, we saved repo as a variable with a value of some fake data and used it again as the second repo value, both repos will have the same fake value.
Documentation
See documentation for the Blinq.io app.