This project provides a tool for specifying Drupal architecture details and generating automated tests for them. It consists of 1) a Google Sheet for capturing specification and generating tests from it and 2) the Behat contexts that automate the generated tests.
Copy the current version of the Google sheet to your Google Drive.
Assuming you already have Behat installed via Composer...
-
Install the Behat contexts:
Note: If you're using BLT the Drupal Spec Tool is already included as part of
blt/composer.suggested.json.composer require --dev acquia/drupal-spec-tool
-
Add the new contexts to your Behat configuration, e.g.:
# behat.yml default: suites: default: contexts: - Acquia\DrupalSpecTool\Context\AccessControlContext - Acquia\DrupalSpecTool\Context\ContentModelContext - Acquia\DrupalSpecTool\Context\MediaContext - Acquia\DrupalSpecTool\Context\MenuContext - Acquia\DrupalSpecTool\Context\ViewsContext - Acquia\DrupalSpecTool\Context\WorkflowContext
-
Create a Behat feature file for each generated feature on the "Behat" tab of the Google sheet (e.g.,
content_model.feature) and copy the Gherkin into it. (See Advanced below to automate this process.) -
Run Behat! If the tests pass, your application already matches the specification. If not, change one or the other according to your needs.
Learn more about the features of the tool and best practices for using it in the announcement blog post on the Acquia Developer Center.
Automate test updates with nickwilde1990/drupal-spec-tool-commands.
See open bug reports in the issue queue.
Contributions are welcome! See CONTRIBUTING.md.
Copyright (C) 2018 Acquia, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
