forceedge01 / bdd-analyser
Analyse bdd scripts and find issues with detailed information and how to address these issues to prolong the longevitiy of your behaviour suite
Requires
- php: ^8.0
- forceedge01/bdd-analyser-rules: ^2.0
- guzzlehttp/guzzle: ^7.5
- symfony/console: ^5.0
- symfony/yaml: ^6.0
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-11-10 00:54:07 UTC
README
Perform static analysis on your cucumber/gherkin styles bdd scripts and remediate issues that will prolong the life your test suite.
This tool is meant to be language agnostic (even though written in PHP7) and expected to work with any cucumber/gherkin style files.
Here is an example of a basic run:
Html report:
- Summary of analysis.
- Segmented data view.
- Track your fixes as you resolve them.
Install
Detailed setup blog post https://inevitabletech.uk/blog/static-analysis-for-your-bdd-scripts/
Quick Installation:
composer global require forceedge01/bdd-analyser
Initialise config file to root of project, setup includes the kind of files you want to scan and the rules you want applied.
Example run:
bdd-analyser init
bdd-analyser scan . --config=.
The above command will lint the features folder.
Configure the bdd-analyser-config.yaml file with the extension of the files that contain the cucumber/gherkin scripts.
feature_file_extension: feature
Major change
- PHP version 8.0 compatible.
Development
make install
Adding new rules is as simple as creating a new class and extending it from the BaseRule class which implements the necessary interface and abstraction.
namespace MyApp\BddScriptRules; use Forceedge01\BDDStaticAnalyserRules\Entities; use Forceedge01\BDDStaticAnalyserRules\Rules; class MyRule extends Rules\BaseRule { }
Then simply add your new class to the bdd-analyser-config.yaml rules array.
... rules: ... - MyApp\BddScriptRules\MyRule ...