wdio-cucumber-snippet-reporter

0.0.5 • Public • Published

A WebdriverIO plugin to generate cucumber step definitions snippets to paste in your code.

Run a test. It automaticly reports you the snippet output when steps are not specified. Copy and paste the snippet in your step definitions file. When ready with your step remove the line "return 'pending'" and off you go!

Spec Reporter

Installation

The easiest way is to keep wdio-cucumber-snippet-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "wdio-cucumber-snippet-reporter": "~0.0.5"
  }
}

You can simple do it by:

npm i wdio-cucumber-snippet-reporter -D

Configuration

Following code shows the default wdio test runner configuration. Just add 'cucumber-snippet' as reporter to the array.

To make it work, the parameter value of: ignoreUndefinedDefinitions in cucumberOpts must be set to true.

// wdio.conf.js
module.exports = {
  // ...
  reporters: ['dot', 'spec', 'cucumber-snippet'],
  // ...
  cucumberOpts: {
    // ...
      ignoreUndefinedDefinitions: true,  
    // ...    
  }
};

Development

All commands can be found in the package.json. The most important are:

Watch changes:

$ npm run watch

Run tests:

$ npm test

# run test with coverage report:
$ npm run test:cover

Build package:

$ npm run build

Dependencies (0)

    Dev Dependencies (19)

    Package Sidebar

    Install

    npm i wdio-cucumber-snippet-reporter

    Weekly Downloads

    3,252

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    20 kB

    Total Files

    9

    Last publish

    Collaborators

    • jvaniperen