Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

testcucumbr-generator

VagnerSilva20MIT1.0.8

Cucumber step generator

cucumber, cypress, BDD, features, feature, testing, testcucumbr-generator, multiple languages

readme

testcucumbr-generator

Generates steps in multiple languages for cypress-cucumber-preprocessor and @cucumber/cucumber

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

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 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

// testcucumbr.conf.js

module.exports = {
    type: 'cypress',
    formatFile: 'js',
    featurePath: './crypress/integration/features',
    defaultDialect: 'pt',
    arrow: true,
};
# 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

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';
});

changelog

Changelog

[1.0.8] 2021-06-09

Add support cucumber 7.3.1

Changelog

[1.0.7] 2021-06-09

Fix - nx - create or verify new steps

Changelog

[1.0.6] 2021-06-03

Add - 'arrow' property in config file to use arrow functions as default

Changed

Fix - regex escape

Changelog

[1.0.5] 2021-06-03

Changed

Fix - regex escape

Changelog

[1.0.4] 2021-03-22

Changed

Fix - Error: EISDIR: illegal operation on a directory, read

[1.0.31] 2021-03-22

Changed

update README.md

[1.0.3] 2021-03-22

Changed

required("cypress-cucumber-preprocessor") to required"cypress-cucumber-preprocessor/steps"

[1.0.2] 2021-05-21

Changed

add .gitignore

[1.0.1] 2021-03-28

Changed

js/ts extension for _spec.{js,ts}

Read.me text