PHPackages                             edno/codeception-gherkin-param - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. edno/codeception-gherkin-param

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

edno/codeception-gherkin-param
==============================

Codeception module for supporting parameter notation in Gherkin features

2.0.13(3y ago)9137.2k↓22.8%41Apache-2.0PHPPHP &gt;=7.4 &lt;9.0

Since May 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/edno/codeception-gherkin-param)[ Packagist](https://packagist.org/packages/edno/codeception-gherkin-param)[ Docs](https://edno.github.io/codeception-gherkin-param)[ RSS](/packages/edno-codeception-gherkin-param/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (14)Versions (28)Used By (1)

Gherkin Param
=============

[](#gherkin-param)

[![Latest Version](https://camo.githubusercontent.com/0168210efb051008466df0e2595e99261f98c21a83e3bfed1d6ee6332e4dbbf8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65646e6f2f636f646563657074696f6e2d676865726b696e2d706172616d2e737667)](https://packagist.org/packages/edno/codeception-gherkin-param)[![Build Status](https://camo.githubusercontent.com/04cd07662549505c372797b4f77f69e7f73c24bb048f3e3760490b80dffdadbf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65646e6f2f636f646563657074696f6e2d676865726b696e2d706172616d2f72756e2d74657374732e796d6c)](https://camo.githubusercontent.com/04cd07662549505c372797b4f77f69e7f73c24bb048f3e3760490b80dffdadbf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65646e6f2f636f646563657074696f6e2d676865726b696e2d706172616d2f72756e2d74657374732e796d6c)[![Coverage Status](https://camo.githubusercontent.com/0b22e06b730335dffbeec91ab605268b223eedf52a7c69288eff98d198d748dc/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f65646e6f2f636f646563657074696f6e2d676865726b696e2d706172616d2e737667)](https://coveralls.io/github/edno/codeception-gherkin-param?branch=main)[![Mutation Score](https://camo.githubusercontent.com/99ccefc07a283b21e0934f32410762695333e9cf6fd27a1b1c79cc1a735e3b43/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f6c6162656c3d6d75746174696f6e25323073636f72652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324665646e6f253246636f646563657074696f6e2d676865726b696e2d706172616d2532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/edno/codeception-gherkin-param/main)[![License](https://camo.githubusercontent.com/6056c91dbbc59a4c8523f4420a1b6a63278c01b148278f3a643ea3346c335242/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322d626c75652e737667)](https://raw.githubusercontent.com/edno/codeception-gherkin-param/main/LICENSE)[![FOSSA Status](https://camo.githubusercontent.com/25e21efe12fe090083e42ec96199c2bd573ee27115c145beac92839d7db7ecfb/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d25324665646e6f253246636f646563657074696f6e2d676865726b696e2d706172616d2e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Fedno%2Fcodeception-gherkin-param)

---

The [Codeception](http://codeception.com/) module for supporting parameter notation in [Gherkin](https://codeception.com/docs/07-BDD)scenario.

Minimum Requirements
--------------------

[](#minimum-requirements)

- Codeception 3.x, 4.x, 5.x
- PHP 7.4 - 8.2 (use release 2.0.6 for older PHP versions)

Installation
------------

[](#installation)

The module can be installed using [Composer](https://getcomposer.org)

```
composer require edno/codeception-gherkin-param --dev
```

Be sure to enable the module in `codeception.yml` as shown in [configuration](#configuration) below.

Setup
-----

[](#setup)

Enabling **Gherkin Param** is done in `codeception.yml`.

```
modules:
    enabled:
        - Codeception\Extension\GherkinParam
```

Configuration
-------------

[](#configuration)

> By default **GherkinParam** behavior is to keep the parameter string unchanged when the replacement value for a parameter cannot be found, i.e., the parameter does not exist or is not accessible.

### `onErrorThrowException`

[](#onerrorthrowexception)

If `true`, then GherkinParam will throw an exception `GherkinParam` at runtime when a replacement value cannot be found for a parameter:

```
modules:
    enabled:
        - Codeception\Extension\GherkinParam:
            onErrorThrowException: true
```

> If `onErrorThrowException` is set then it will override `onErrorNullable`.

### `onErrorNullable`

[](#onerrornullable)

If `true`, then GherkinParam will set to `null` parameters for which a replacement value cannot be found:

```
modules:
    enabled:
        - Codeception\Extension\GherkinParam:
            onErrorNullable: true
```

Usage
-----

[](#usage)

Once installed, you will be able to access variables stored using [Fixtures](https://codeception.com/docs/reference/Fixtures.html).

### Simple parameters

[](#simple-parameters)

In scenario steps, the variables can be accessed using the syntax `{{param}}`. While executing your features, the variables will be automatically replaced by their value.

### Array parameters

[](#array-parameters)

You can refer to an element in an array using the syntax `{{param[key]}}`.

### Test Suite Config parameters

[](#test-suite-config-parameters)

You can refer to a test suite configuration parameter using the syntax `{{config:param}}`. Note that the keyword **config:** is mandatory.

Example
-------

[](#example)

```
Feature: Parametrize Gherkin Feature
  In order to create a dynamic Gherkin scenario
  As a tester
  I need to be able to share data between scenario steps

  Scenario: Scenario using simple parameter
    Given I have a parameter "test" with value "42"
    Then I should see "{{test}}" equals "42"

  Scenario: Scenario using array parameter
    Given I have an array "test" with values [1, two, 3.14, IV, 101]
    Then I should see "{{test[1]}}" equals "two"

  Scenario: Scenario using config parameter
    Given I have a configuration file "acceptance.suite.yml" containing
      """
      theResponse: 42
      """
    When I execute a scenario calling the parameter 'theResponse'
    Then I should see "{{config:theResponse}}" equals "42"
```

The steps definition in `AcceptanceTester.php` do not require any change

```
/**
 * @Given I have a parameter :param with value :value
 */
 public function iHaveAParameterWithValue($param, $value)
 {
   Fixtures::add($param, $value);
 }

/**
 * @Then I should see :arg1 equals :arg2
 */
 public function iSeeEqual($arg1, $arg2)
 {
   $this->assertEquals($arg1, $arg2);
 }
```

You can find more examples in the [test folder](https://github.com/edno/codeception-gherkin-param/tree/main/tests/acceptance).

Contributions
-------------

[](#contributions)

Contributions, issues, and feature requests are very welcome. If you use this package and have fixed a bug for yourself, please consider submitting a PR!

[ ![](https://camo.githubusercontent.com/cfa9657de6bcca65f60636d9d0ddef56b8da2486aa50d7216a6d9b398fe12875/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d65646e6f2f636f646563657074696f6e2d676865726b696e2d706172616d)](https://github.com/edno/codeception-gherkin-param/graphs/contributors)Made with [contributors-img](https://contrib.rocks).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~94 days

Recently: every ~130 days

Total

27

Last Release

1230d ago

Major Versions

0.3.0 → 1.0.02016-06-30

1.0.8 → 2.0.02020-02-09

PHP version history (6 changes)0.1.0PHP &gt;=5.4

1.0.5PHP &gt;=7.0

2.0.1PHP &gt;=7.2

2.0.2PHP ~7.2

2.0.4PHP &gt;=7.2 &lt;9.0

2.0.7PHP &gt;=7.4 &lt;9.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/bac1c0fc36754df981413489651483354aff2a059923108338a64f0a62405980?d=identicon)[edno](/maintainers/edno)

---

Top Contributors

[![edno](https://avatars.githubusercontent.com/u/324670?v=4)](https://github.com/edno "edno (149 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![gimler](https://avatars.githubusercontent.com/u/200904?v=4)](https://github.com/gimler "gimler (7 commits)")[![ekhvalov](https://avatars.githubusercontent.com/u/6489904?v=4)](https://github.com/ekhvalov "ekhvalov (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

bddcodeceptioncodeception-extensioncodeception-moduledataprovidergherkinparametersphpscenariotestingtestcodeceptionBDDgherkinextensionmodule

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/edno-codeception-gherkin-param/health.svg)

```
[![Health](https://phpackages.com/badges/edno-codeception-gherkin-param/health.svg)](https://phpackages.com/packages/edno-codeception-gherkin-param)
```

###  Alternatives

[behat/behat

Scenario-oriented BDD framework for PHP

4.0k101.8M2.2k](/packages/behat-behat)[orchestra/testbench-core

Testing Helper for Laravel Development

27248.1M386](/packages/orchestra-testbench-core)[lucatume/wp-browser

A set of Codeception modules to test WordPress projects.

6424.1M180](/packages/lucatume-wp-browser)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

623.9M53](/packages/dvdoug-behat-code-coverage)[mcustiel/phiremock-codeception-extension

Codeception extension for Phiremock. Allows to stub remote services for HTTP requests.

311.1M6](/packages/mcustiel-phiremock-codeception-extension)[mcustiel/codeception-http-mock

Extension for HTTP Mock.

1424.3k1](/packages/mcustiel-codeception-http-mock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
