README

Introduction

Behat is great for facilitating conversations between
business managers and developers. Those are useful conversations, but many
organizations simply can't/wont converse via Gherkin. When you are on the hook for
product quality and not conversations, this is a testing approach for you.

Installation

composer require 'weitzman/drupal-test-traits'

Authoring tests

Pick a test type:

ExistingSiteBrowser. See ExampleTest.php. These tests can be small unit tests up to larger Functional tests (via Goutte).

ExistingSiteSelenium2. See ExampleSelenium2DriverTest.php. These tests make use of any browser which can run in web driver mode(Chrome, FireFox or Edge) via Selenium, so are suited to testing Ajax and similar client side interactions. This browser setup can also be used to run Drupal 8 core JS testing using nightwatch. These tests run slower than ExistingSite.

ExistingSiteWebDriver. See ExampleWebDriverTest.php. These tests make use of a headless Chrome browser, so are suited to testing Ajax and similar client side interactions. These tests run slower than ExistingSite.

Running tests

You must specify the URL to your site as an environment variable: DTT_BASE_URL=http://example.com. For ExistingSiteJavascript also specify DTT_MINK_DRIVER_ARGS=["firefox", null, "http://selenium:9222/wd/hub"] or DTT_API_URL=http://localhost:9222. Here are three ways to do that: