npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gherkin-detailer

v2.4.0

Published

gherkin-detailer is a tool that check the gherkins included in you project and lists them, highlights their similarities.

Downloads

257

Readme

Coverage Status

gherkin-detailer

gherkin-detailer is a powerful tool designed to analyze and optimize your gherkin files within a project. It helps you maintain a clean and efficient codebase by providing an overview of your gherkin files and highlighting potential duplications.

Documentation

Introduction

gherkin-detailer is a tool that generates comprehensive HTML reports for the gherkin files in your project. These reports help you manage and optimize your gherkin scenarios, ensuring a cleaner and more efficient codebase. The tool currently provides six detailed sections:

  • Files List: Contains the entire list of all detailed scenarios.
  • Features List: Provides a simple list of all the features.
  • Scenarios List: Offers a simple list of all scenarios and scenario outlines.
  • States List: Lists all the Given states.
  • Actions List: Lists all the When actions.
  • Outcomes List: Lists all the Then outcomes.

Each detail in these sections is color-coded to highlight potential similarities, helping you identify and address code duplication within your project.

Examples

Example: Files Section

example 1

The Files section lists all the gherkin scenarios across all *.feature files in your project. This page serves as a comprehensive documentation of your project, organized by file and detailing all specific use cases.

Color Coding

The color coding provides additional insights into the gherkin elements:

  • Red: Indicates elements that are identical across all gherkins. These elements (actions, outcomes, scenarios, etc.) represent the same entity across different files, suggesting that there should be a single, specific piece of code associated with all of them. Developers should ensure that these red-highlighted elements are consistently implemented and do not require multiple definitions.

  • Orange: Highlights elements that are similar across gherkins. These elements may represent different entities but with some common attributes. Developers should review these orange-highlighted elements to verify whether the similarities are accurate and whether they truly represent distinct entities with different code. This check helps prevent potential errors and code duplication.

Example: Actions Section

example 2

The Actions section lists all the actions (When steps) present in your gherkin files. This page helps developers quickly locate and review all the actions defined across the project.

Navigation Menu

The navigation menu allows developers to efficiently move between different sections of the report:

  • Files: Provides a general overview of all gherkin files in the project.
  • Features: Lists all the features present in your gherkin files.
  • Scenarios: Displays all scenarios and scenario outlines.
  • States: Shows all Given states.
  • Actions: Lists all When actions (this section).
  • Outcomes: Lists all Then outcomes.

This menu enables you to switch between sections to gain detailed insights into specific elements of your gherkin files, allowing for thorough analysis and easy navigation throughout the project.

Requirements

  • node 10.12+
  • npm 6.0+

Installation

gherkin-detailer can be installed as a global tool:

$ npm install -g gherkin-detailer

$ yarn global add gherkin-detailer

or as a devDependency:

$ npm install -D gherkin-detailer

$ yarn add --dev gherkin-detailer

Usage

If you've installed it as a devDependency, you need to add it in the script section of the package.json.

To execute it with all default options, so to let its analysis starts from the current folder, set this up:

"gherkin-detailer": "gherkin-detailer"

To customize the analysis folder, set this up:

"gherkin-detailer": "gherkin-detailer -a './src/'"

To customize the output folder, set this up:

"gherkin-detailer": "gherkin-detailer -o './report/'"

To customize the report theme, set this up:

"gherkin-detailer": "gherkin-detailer -t 'black'"

Then the gherkin-detailer can be executed in order to have a gherkins report created in a default folder ./report/gherkin-detailer/

$ npm run gherkin-detailer

$ yarn gherkin-detailer

Help


$ gherkin-detailer --help

Usage: gherkin-detailer [options] <option>

  Options:

    -v, --version                           Output the version number
    -a, --analysis [analysis]               Select folder to analyse
    -o, --output [output]                   Select folder to output
    -t, --theme [theme]                     Select report theme (white|black)
    -h, --help                              Output usage information