🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

generator-cucumber-steps

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-cucumber-steps

Fast steps-defs based on features generation :watermelon:

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

generator-cucumber-steps NPM version Build Status Dependency Status Coverage percentage

Fast steps-defs based on features generation :watermelon:

demo

This docs on Russian.

You are tired of creating a "steps file"? Me too, so I decided to simplify my problem.

Installation

npm install -g yo
npm install -g generator-cucumber-steps

Executing

yo cucumber-steps

Select path to the feature-file (without file extension) and location where will be generated a stepsDefs file. It's simple!

Examples

Feature: title
  Scenario: title
    Given precondition with "1" and "2"
    When action
    And addition
    Then testable outcome equals "1"

If you have same feature with parameters, you'll recieve:

const {defineSupportCode} = require('cucumber');

defineSupportCode(function ({Given, When, Then}) {
  Given(/^precondition with "(.*)" and "(.*)"$/, function (param1, param2) {
    return true;
  });
  When(/^action$/, function () {
    return true;
  });
  And(/^addition$/, function () {
    return true;
  });
  Then(/^testable outcome equals "(.*)"$/, function (param1) {
    return true;
  });
});

Some notes

Dictionary in new version of gherkin was changed. Be careful if you write your features with locale support!

For example, in Russian localization, key word Если now refer to Given. Use Когда or synonyms of И.

License

MIT Š lamartire

Keywords

cucumber steps features testing bdd

FAQs

Package last updated on 23 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts