Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gherking/gpc-scenario-numbering

The ScenarioNumbering precompiler is responsible for adding an index to all scenarios and scenario outlines.
https://github.com/gherking/gpc-scenario-numbering

cucumber feature-file gherkin gherking gpc hacktoberfest precompiler typescript

Last synced: 1 day ago
JSON representation

The ScenarioNumbering precompiler is responsible for adding an index to all scenarios and scenario outlines.

Awesome Lists containing this project

README

        

# gpc-scenario-numbering

![Downloads](https://img.shields.io/npm/dw/gpc-scenario-numbering?style=flat-square) ![Version@npm](https://img.shields.io/npm/v/gpc-scenario-numbering?label=version%40npm&style=flat-square) ![Version@git](https://img.shields.io/github/package-json/v/gherking/gpc-scenario-numbering/master?label=version%40git&style=flat-square) ![CI](https://img.shields.io/github/workflow/status/gherking/gpc-scenario-numbering/CI/master?label=ci&style=flat-square) ![Docs](https://img.shields.io/github/workflow/status/gherking/gpc-scenario-numbering/Docs/master?label=docs&style=flat-square)

The ScenarioNumbering precompiler is responsible for adding an index to all scenarios and scenario outlines.

## Example

```gherkin
@tag1
Scenario Outline: Test language ()
Given I am on Home page user
When language is choosen
Then I should be on Home page
And the title should be ""

@tag2
Examples:
| language | title |
| EN | Welcome |
| FR | Bienvenue |

Scenario: Test without tag
Given I am on Home page user
Then I should be on Home page
```
It will be modified to:
```gherkin
@tag1
Scenario Outline: 1. Test language ()
Given I am on Home page user
When language is choosen
Then I should be on Home page
And the title should be ""

@tag2
Examples:
| language | title |
| EN | Welcome |
| FR | Bienvenue |

Scenario: 2. Test without tag
Given I am on Home page user
Then I should be on Home page
```

## Configuration

ScenarioNumbering accepts the following configuration:

| Option | Type | Description | Default |
|:------:|:----:|:------------|:--------|
| `format` | `String` | The format, how index should be added to the name of the scenario/scenairo outline. Possible tokens:


  • `${name}` the original name

  • `${i}` the index

| `${i}. ${name}` |

## Other
This package uses [debug](https://www.npmjs.com/package/debug) for logging, use `gpc:scenario-numbering` :
```shell
DEBUG=gpc:scenario-numbering* gherking ...
```
For detailed documentation see the [TypeDocs documentation](https://gherking.github.io/gpc-scenario-numbering/).