scenario
Scenario is a vertical test composer based on tape. Generically speaking, it allows you to compose a set of independent test steps into multiple test scenarios. It is primarily aimed at being a system test runner for tests based on the Gherkin BDD langauge and a lightweight alternative to Cucumber.js. A feature of a system is tested by constructing test scenarios, each of which is associated with a collection of named test steps. Each step is defined and implemented independently, using a context variable to pass data between steps, allowing for simple DRY code. Collections of related scenarios define test cases for a feature.
Example
// index.js var test = var scenario = var feature = // Register the scenarios with the test builder // Build the tape testsvar tests = scenario // Run the teststests0test
// example.feature.js { scenario scenario scenario scenario}
# example.feature Feature: Example Feature In order to be productive, as a user I want to do things Scenario: A user does something Given I am a user And I want to do something When I do the thing Then something happens
Tools
Gherkin feature scaffolding
Gherkin test runner
Installation
npm install scenario
or for the gherkin tools
npm install scenario -g
Contributors
- Matt-Esch