From 4d9aca80701719322bbb8a91639ceb3798e9171c Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Wed, 28 Nov 2018 17:27:53 +0100 Subject: [PATCH] Add support for ahoy and update the templates --- ahoy.yml | 11 +++++++++++ composer.json | 6 ++++++ src/Handler.php | 2 ++ templates/FeatureContext.php.twig | 8 +++++--- templates/behat.yml.twig | 2 -- 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 ahoy.yml diff --git a/ahoy.yml b/ahoy.yml new file mode 100644 index 0000000..8bd9563 --- /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 d8696a9..97d20a5 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 4dfc0f5..0a8d9da 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 362a9fb..82eb947 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 b744088..f607d08 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: -- GitLab