Use Gherkin DSL steps based on Drupal 8 within Codeception. This work is mainly based on the excellent Behat Extension named drupal/drupal-extension. This module is based on Codeception 2.3 or higher.
Within the config
directory, there is an example of how to configure your Codeception suite.
bin/
config/
src/
tests/
vendor/
Via Composer
$ composer require arocom/codeception-drupal
Substitute <Suite>
with your suite, it's normally in lower case.
The working_directory
key within the DrupalDrush module is the absolute path of your drupal installation.
actor: <Suite>Tester
modules:
enabled:
- WebDriver
- Asserts
- \Helper\<Suite>
- \Codeception\Module\Context\MinkContext
- \Codeception\Module\Context\AcceptanceContext
- \Codeception\Module\Context\BatchContext
- \Codeception\Module\Context\MarkupContext
- \Codeception\Module\Context\DrushContext
- DrupalDrush
config:
WebDriver:
url: 'https://www.drupal.org'
browser: chrome
host: '127.0.0.1'
port: 4444
window_size: 1920x1080
\Codeception\Module\Context\MinkContext:
DI: 'WebDriver'
PSR-7: '\GuzzleHttp\Client'
\Codeception\Module\Context\AcceptanceContext:
DI: 'WebDriver'
PSR-7: '\GuzzleHttp\Client'
\Codeception\Module\Context\BatchContext:
DI: 'WebDriver'
PSR-7: '\GuzzleHttp\Client'
\Codeception\Module\Context\MarkupContext:
DI: 'WebDriver'
PSR-7: '\GuzzleHttp\Client'
\Codeception\Module\Context\DrushContext:
DI: 'WebDriver'
PSR-7: '\GuzzleHttp\Client'
Drush: 'DrupalDrush'
DrushAlias: 'drush'
DrupalDrush:
working_directory: '/var/www/drupal' # Absolute path
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email :author_email instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.