2017 © Pedro PelĂĄez
 

library behat-analysis-extension

Analysis tool for Behat

image

gquemener/behat-analysis-extension

Analysis tool for Behat

  • Friday, May 18, 2018
  • by GildasQ
  • Repository
  • 2 Watchers
  • 25 Stars
  • 9,374 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 4 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Behat analysis extension

Latest Stable Version Build Status, (*1)

Introduction

Why?, (*2)

Well, I always start asking "why?" when encoutering some crazy project. So, I will start by answering this trivial question., (*3)

I've simply realised that the more a project grows, the more its FeatureContext also grows! Some of the ones I've worked on have more than 1000 lines of code and it suffers from the same maintainability issues than any other huge class. Many great tools already exists to provide solution against this drawback: OOP, SubContexts, PageObjectContext, ..., (*4)

But still, sometimes you need to look at your past and try to improve what you've done and that's why I've done this extension!, (*5)

This extension provides some basic analysis about your step definitions. For the moment, it focuses on rarely used steps and similar ones., (*6)

Installation

  1. Define dependencies in your composer.json:

``` javascript { "require": { ..., (*7)

        "gquemener/behat-analysis-extension": "~1.0"
}

}, (*8)


2. Install/update your vendors: ``` bash $ curl http://getcomposer.org/installer | php $ php composer.phar install
  1. Activate extension by specifying its class in your behat.yml:

``` yaml # behat.yml default: # ... extensions: Behat\AnalysisExtension\Extension: ~, (*9)


Usage ---- After installation, a new `analysis` formatter should be available. Then, run your feature suite using it: ``` bash $ bin/behat -fanalysis --dry-run

NB: It's recommended (but not mandatory) to run the analysis using the --dry-run option to accelerate the report generation., (*10)

Example

    $ bin/behat -fanalysis --dry-run
        ---------------------------------------------------------------------- 70
        ---------------------------------------------------------------------- 140
        ---------------------------------------------------------------------- 210
        ---------------------------------------------------------------------- 280
        ---------------------------------------------------------------------- 350
        ------------------------

        58 scenarios (58 skipped)
        374 steps (374 skipped)

        Behat Steps Analysis
        ====================
        40 steps were used once.
        The most used step is /^I am logged in as "([^"]*)"$/ with 58 calls.
        Some steps might be merged to reduce their implementation redundancy:
          - /^I am on the "([^"]*)" attribute page$/ and /^I am on the "([^"]*)" product page$/
          - /^I enable the product$/ and /^I disable the product$/
          - /^I enable the product$/ and /^I save the product$/
          - /^an enabled "([^"]*)" product$/ and /^a disabled "([^"]*)" product$/

Contribution

It is more than welcome as always!, (*11)

Feel free to contact me on twitter @GildasQ or through the issue system., (*12)

The Versions

18/05 2018

dev-feature/behat-3

dev-feature/behat-3

Analysis tool for Behat

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gildas Quéméner

17/07 2013

dev-master

9999999-dev

Analysis tool for Behat

  Sources   Download

MIT

The Requires

 

The Development Requires

17/07 2013

v1.0.0

1.0.0.0

Analysis tool for Behat

  Sources   Download

MIT

The Requires

 

The Development Requires