diff --git a/ahoy.yml b/ahoy.yml new file mode 100644 index 0000000000000000000000000000000000000000..8bd9563dc66eeba3a1725f148be403cec3bb2342 --- /dev/null +++ b/ahoy.yml @@ -0,0 +1,11 @@ +ahoyapi: v2 +commands: + test: + cmd: docker-compose exec -T --user root php ./vendor/bin/behat --config tests/behat/behat.yml "$@" + usage: Run Behat tests on the project + test2xml: + cmd: docker-compose exec -T --user root php ./vendor/bin/behat --config tests/behat/behat.yml --format junit --out tests/output "$@" + usage: Run Behat tests on the project and output in junit format + update: + cmd: composer b4d "$@" + usage: Update Behat4Drupal setup in project diff --git a/composer.json b/composer.json index d8696a9f8ff6e1fd076dacf36ce90ec1caae5b4d..97d20a57c7ad95028459e88c6b7240e8f1297c42 100644 --- a/composer.json +++ b/composer.json @@ -63,6 +63,12 @@ "callback": "LakeDrops\\Behat4Drupal\\Plugin::config", "description": "(Re-)Configure Behat for this project." } + }, + "ahoy": { + "b4d": { + "usage": "Behat for Drupal", + "imports": ["ahoy.yml"] + } } } } diff --git a/src/Handler.php b/src/Handler.php index 4dfc0f514ff919b7ccdf0b275a44d9833f32a2e8..0a8d9daad5ac464ef1ccb9cce6c7f5377cfadfe7 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -76,6 +76,8 @@ class Handler extends BaseHandler { } $fs->chmod($file, 0664); } + + $this->git('ignore tests/output'); } /** diff --git a/templates/FeatureContext.php.twig b/templates/FeatureContext.php.twig index 362a9fb4feed67fafac1fb3e77c29b8e5dd7d89c..82eb94730b1c7616f7105ca630d3c4fc7f1c4cd0 100644 --- a/templates/FeatureContext.php.twig +++ b/templates/FeatureContext.php.twig @@ -1,8 +1,10 @@ <?php +use Drupal\DrupalExtension\Context\RawDrupalContext; -use Behat\WebApiExtension\Context\WebApiContext; - -class FeatureContext extends WebApiContext { +/** + * Defines application features from the specific context. + */ +class FeatureContext extends RawDrupalContext { } diff --git a/templates/behat.yml.twig b/templates/behat.yml.twig index b7440886f81832f9c76f7f2a383982f7dd08efdf..f607d085ce0ac71f868a514cf3628c7c51ba51c6 100644 --- a/templates/behat.yml.twig +++ b/templates/behat.yml.twig @@ -31,8 +31,6 @@ default: capabilities: marionette: null locationContextEnabled: false - Behat\WebApiExtension: - base_url: http://{{ projectname }}.docker.localhost:8000 autoload: '': "%paths.base%/bootstrap/context/" suites: