Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.66 KB

behat.md

File metadata and controls

54 lines (40 loc) · 1.66 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://hello-world.drude
      selenium2:
        wd_host: http://browser.hello-world.docker: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.

Important note

base_url: http://hello-world.drude and wd_host: http://browser.hello-world.docker:4444/wd/hub should be configured based on your docker-compose.yml settings for VIRTUAL_HOST in the web container definition and DOMAIN_NAME in the browser container definition.

Running tests

Tests can be launched with dsh (Drude Shell):

dsh behat

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