# testcucumbr-generator

> Cucumber step generator

Latest version **1.0.8** (published 2021-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install testcucumbr-generator
pnpm add testcucumbr-generator
yarn add testcucumbr-generator
bun add testcucumbr-generator
```

Provides the command `testcucumbr`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-08-19 |
| First published | 2021-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vagner Silva |
| Maintainers | vagners |
| Keywords | cucumber, cypress, BDD, features, feature, testing, testcucumbr-generator, multiple languages |

## Links

- npm: https://www.npmjs.com/package/testcucumbr-generator
- Repository: https://github.com/VagnerSilva/testcucumbr-generator
- Homepage: https://github.com/VagnerSilva/testcucumbr-generator#readme
- Issues: https://github.com/VagnerSilva/testcucumbr-generator/issues
- npm.io page: https://npm.io/package/testcucumbr-generator

## Dependencies (6)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [glob](https://npm.io/package/glob.md) ^7.1.6
- [gherkin](https://npm.io/package/gherkin.md) ^9.0.0
- [insert-line](https://npm.io/package/insert-line.md) ^1.1.0
- [@cucumber/cucumber](https://npm.io/package/@cucumber/cucumber.md) ^7.3.1
- [@cucumber/messages](https://npm.io/package/@cucumber/messages.md) ^14.0.1

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2021-08-19
- 1.0.7 — 2021-06-09
- 1.0.6 — 2021-06-03
- 1.0.5 — 2021-06-03
- 1.0.4 — 2021-05-24
- 1.0.31 — 2021-05-22
- 1.0.3 — 2021-05-22
- 1.0.2 — 2021-05-22
- 1.0.1 — 2021-03-28
- 1.0.0 — 2021-03-28

## README

# testcucumbr-generator

Generates steps in multiple [languages](https://cucumber.io/docs/gherkin/languages/) for **[cypress-cucumber-preprocessor](https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/blob/master/README.md)** and **[@cucumber/cucumber](https://github.com/cucumber/cucumber-js/blob/master/README.md)**

The `testcucumbr-generator` basically will lookup for all features in given diretory and generator `_spec.js` or `_spec.ts` files acordingly.
It also includes new steps without changing or deleting previously entered steps.

# Installation

```bash
npm i testcucumbr-generator

yarn add testcucumbr-generator

pnpm i testcucumbr-generator
```

# Configuration

Create the **testcucumbr.conf.js** file at the root of the project.

| Option         | Default value | Description                                                                                                              | type         |
| -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------ |
| featurePath    | -             | Define the path to a folder containing all **`.features`** files                                                         | **required** |
| defaultDialect | **en**        | Define the default language used. You can see more languages ​​in [gherkin](https://cucumber.io/docs/gherkin/languages/) | optional     |
| type           | **cypress**   | Define the model type. **`'cypress'`** or **`'cucumber'`**                                                               | optional     |
| formatFile     | **js**        | Define the format file. **`'js'`** or **`'ts'`**                                                                         | optional     |
| arrow          | **false**     | Define arrow function as default.                                                                                        | optional     |

# Examples

```javascript
// testcucumbr.conf.js

module.exports = {
    type: 'cypress',
    formatFile: 'js',
    featurePath: './crypress/integration/features',
    defaultDialect: 'pt',
    arrow: true,
};
```

```gherkin
# language: pt

Funcionalidade: Pesquisando no Google

    Cenário: Pesquisa simples no Google
     Dado que um navegador da web está na página do Google
     Quando a frase de pesquisa "panda" é inserida
     Então os resultados para "panda" são mostrados
```

Execute the command
**.\node_modules\\.bin\testcucumbr**

```javascript
const { Given, When, Then } = require('cypress-cucumber-preprocessor/steps');

Given('que um navegador da web está na página do Google', () => {
    // Write code here that turns the phrase above into concrete actions
    return 'pending';
});

When('a frase de pesquisa {string} é inserida', (string) => {
    // Write code here that turns the phrase above into concrete actions
    return 'pending';
});

Then('os resultados para {string} são mostrados', (string) => {
    // Write code here that turns the phrase above into concrete actions
    return 'pending';
});
```

---
_Source: https://npm.io/package/testcucumbr-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
