Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.34 KB

behat.md

File metadata and controls

47 lines (36 loc) · 1.34 KB

Using Behat

Expected folder structure

Drude expects your Behat tests to be in tests/behat folder of the project repo.

tests/behat
  \_ bin/behat
  \_ behat.yml
  \_ composer.json
  \_ composer.lock

See drude-testing repo for a good working example. This repo is used for automated tests of Drude builds.

Docker profile example

Assuming you are using Behat Drupal Extension add the following profile in your behat.yml file:

# Docker profile.
# For use inside the CLI container in Drude.
docker:
  extensions:
    Behat\MinkExtension:
      # URL of the site when accessed inside Drude.
      base_url: http://web
      selenium2:
        wd_host: http://browser:4444/wd/hub
      # Stick with chrome by default. It's 2x faster than firefox or phantomjs (your results may vary).
      browser_name: chrome
    Drupal\DrupalExtension:
      drupal:
        # Site docroot inside Drude.
        drupal_root: /var/www/docroot
      drush:
        # Site docroot inside Drude.
        root: /var/www/docroot

This will configure Behat for use with Drude.

Running tests

Tests can be launched with dsh (Drude Shell):

dsh behat

This will download composer dependencies and run behat with the docker profile.