Download the PHP package lucatume/codeception-steppify without Composer
On this page you can find all versions of the php package lucatume/codeception-steppify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucatume/codeception-steppify
More information about lucatume/codeception-steppify
Files in lucatume/codeception-steppify
Package codeception-steppify
Short Description Generate Gherkin steps from Codeception Modules.
License GPL-2.0
Informations about the package codeception-steppify
Steppify
Generate Gherkin steps from Codeception modules.
Installation
Install this package using Composer:
and then add the command to the custom commands used by your project following Codeception documentation on the subject:
Usage
The command will generate traits usable in Codeception tester classes from codeception modules.
As an example I might want to generate Gherkin steps to use Codeception own [PhpBrowser](!g codeception PhpBrowser module) module methods in Gherkin features:
The command will generate PhpBrowserGherkinSteps.php
, a PHP trait
file, in the tests _support/_generated
folder.
To start using the new methods all that's required is to add a use
statement for the PhpBrowserSteps
trait in the suite Tester
class:
You will now be able to write Gherkin features using steps generated from PhpBrowser
module provided methods like:
The command is not limited to Codeception default modules only and will work with any custom module provided by other libraries or custom made for the project.
While the command will make an extra effort to support modules in the Codeception\Module\
name space modules defined outside of that namespace will require the specification of the fully qualified name to work:
This means that is a shortcut for and you may provide any other compatible namespaced class.
Controlling the output methods
While the command will try to be "smart" and helpful in generating the methods signatures it has, and will always have, limits. For this reason the method signature generation logic will take into account cascading definitions during the generation process:
- if available use the configuration file
- else available use the method documentation block
- else fallback on using the built-in logic
Docblock tags
The command supports two docblock tags to control the generation:
@gherkin
- can beno
to avoid the method from generating any step, or a comma separated list of step types (given
,when
,then
).
Please note that if Gherkin step compatible step definitions are found in the method doc block than those will be used.
Configuration file
The command supports a --steps-config <file.yml>
option that allows specifying which methods and how steps should be generated.
The file has the following format:
If a namespace
option is specified the one specified in the settings file will be overridden by it.
Options
The command supports options meant to make its output controllable to a comfortable degree:
--steps-config <file>
- see the configuration file section; allows specifying the path to a step definition generation configuration file.--prefix <prefix>
- allows specifying a string that should be appended to the generated step file name.--namespace <namespace>
-- allows specifying the namespace steps will be generated into; by default steps would be generated in the_generated
namespace, passingAcme\Namespace
to this option will make traits be generated into theAcme\Project\_generated
namespace.