Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gherking/gpc-step-groups
The StepGroups precompiler is responsible for correcting the gherkin keywords of steps to make the tests more readable.
https://github.com/gherking/gpc-step-groups
cucumber feature-file gherkin gherking gpc hacktoberfest precompiler typescript
Last synced: 24 days ago
JSON representation
The StepGroups precompiler is responsible for correcting the gherkin keywords of steps to make the tests more readable.
- Host: GitHub
- URL: https://github.com/gherking/gpc-step-groups
- Owner: gherking
- License: mit
- Created: 2019-11-03T20:49:41.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-13T04:29:56.000Z (5 months ago)
- Last Synced: 2024-10-21T18:04:17.925Z (25 days ago)
- Topics: cucumber, feature-file, gherkin, gherking, gpc, hacktoberfest, precompiler, typescript
- Language: TypeScript
- Homepage: https://gherking.github.io/step-groups/
- Size: 313 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gpc-step-groups
![Downloads](https://img.shields.io/npm/dw/gpc-step-groups?style=flat-square)
![Version@npm](https://img.shields.io/npm/v/gpc-step-groups?label=version%40npm&style=flat-square)
![Version@git](https://img.shields.io/github/package-json/v/gherking/gpc-step-groups/master?label=version%40git&style=flat-square)
![CI](https://img.shields.io/github/workflow/status/gherking/gpc-step-groups/CI/master?label=ci&style=flat-square)
![Docs](https://img.shields.io/github/workflow/status/gherking/gpc-step-groups/Docs/master?label=docs&style=flat-square)The StepGroups precompiler is responsible for correcting the gherkin keywords of steps to make the tests more readable.
## Example
```gherkin
Given the page is opened
Given the settings are deleted
When the settings menu item is clicked
When the advanced settings link is clicked
Then the advanced settings should be loaded
Then the basic settings link should be visible
```
It will be modified to:```gherkin
Given the page is opened
And the settings are deleted
When the settings menu item is clicked
And the advanced settings link is clicked
Then the advanced settings should be loaded
And the basic settings link should be visible
```## Usage
```javascript
'use strict';
const compiler = require('gherking');
const StepGroups = require('step-groups');let ast = await compiler.load('./features/src/login.feature');
ast = compiler.process(
ast,
new StepGroups({
// config
})
);
await compiler.save('./features/dist/login.feature', ast, {
lineBreak: '\r\n'
});
``````typescript
'use strict';
import {load, process, save} from "gherking";
import Template = require("step-groups");let ast = await load("./features/src/login.feature");
ast = process(
ast,
new Template({
// config
})
);
await save('./features/dist/login.feature', ast, {
lineBreak: '\r\n'
});
```
## OtherThis package uses [debug](https://www.npmjs.com/package/debug) for logging, use `gpc:step-groups` :
```shell
DEBUG=gpc:step-groups* gherking ...
```For detailed documentation see the [TypeDocs documentation](https://gherking.github.io/step-groups/).