ivangrynenko / behat-steps
Collection of Behat traits
0.2
2020-02-04 21:20 UTC
Requires
- behat/behat: ^3
Requires (Dev)
- cweagans/composer-patches: ^1.6.0
- dealerdirect/phpcodesniffer-composer-installer: ^0.5
- drupal/coder: ^8.2.12
- drupal/drupal-extension: ^v3.4
- integratedexperts/behat-format-progress-fail: ^0.2
- integratedexperts/behat-screenshot: ^0.7
- jakub-onderka/php-parallel-lint: ^1.0
- phpcompatibility/php-compatibility: ^9.0
- phpunit/phpunit: ^4.8.36
This package is auto-updated.
Last update: 2025-03-05 07:43:58 UTC
README
Collection of Behat steps for Drupal 8 and Drupal 7 development.
Why traits?
Usually, such packages implement own Drupal driver with several contexts, service containers and a lot of other useful architectural structures. But for this simple library, using traits helps to lower entry barrier for usage, maintenance and support. This package may later be refactored to use proper architecture.
Installation
composer require --dev ivangrynenko/behat-steps
Usage
In `composer.json':
"autoload": {
"psr-4": {
"ivangrynenko\\BehatSteps\\": "src/"
}
},
In FeatureContext.php
:
<?php
use ivangrynenko\BehatSteps\IgContentTrait;
use ivangrynenko\BehatSteps\FileTrait;
use ivangrynenko\BehatSteps\FormElementsTrait;
/**
* Defines application features from the specific context.
*/
class FeatureContext extends DrupalContext {
use IgContentTrait;
use FieldTrait;
use FormElementsTrait;
}
Exceptions
\Exception
is thrown for all assertions.\RuntimeException
is thrown for any unfulfilled requirements within a step.