1.0.8 • Published 3 years ago

testcucumbr-generator v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.

OptionDefault valueDescriptiontype
featurePath-Define the path to a folder containing all .features filesrequired
defaultDialectenDefine the default language used. You can see more languages ​​in gherkinoptional
typecypressDefine the model type. 'cypress' or 'cucumber'optional
formatFilejsDefine the format file. 'js' or 'ts'optional
arrowfalseDefine 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';
});