PHPackages                             acquia/drupal-spec-tool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. acquia/drupal-spec-tool

ActiveBehat-extension[Testing &amp; Quality](/categories/testing)

acquia/drupal-spec-tool
=======================

A tool for specifying Drupal architecture details and generating automated tests for them

v6.2.0(1y ago)1532.6M↓10.5%37[12 issues](https://github.com/acquia/drupal-spec-tool/issues)3GPL-2.0-onlyGherkinPHP &gt;=8.1CI failing

Since May 23Pushed 4mo ago18 watchersCompare

[ Source](https://github.com/acquia/drupal-spec-tool)[ Packagist](https://packagist.org/packages/acquia/drupal-spec-tool)[ RSS](/packages/acquia-drupal-spec-tool/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (21)Used By (3)

Drupal Spec Tool
================

[](#drupal-spec-tool)

[![Packagist](https://camo.githubusercontent.com/57e63937de0c38bbc79b57afaf77abb857279d6a940efe45555aae8323837d75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6163717569612f64727570616c2d737065632d746f6f6c2e737667)](https://packagist.org/packages/acquia/drupal-spec-tool)[![Tests](https://github.com/acquia/drupal-spec-tool/actions/workflows/orca.yml/badge.svg)](https://github.com/acquia/drupal-spec-tool/actions/workflows/orca.yml)

This project provides a tool for specifying Drupal architecture details and generating automated tests for them. It consists of 1) [a Google Sheet](#google-sheet) for capturing specification and generating tests from it and 2) the Behat contexts that automate the generated tests ([examples](../features)).

Getting started
---------------

[](#getting-started)

### Google sheet

[](#google-sheet)

Copy [the current Google sheet](https://docs.google.com/spreadsheets/d/18MALDELw4E5WNFMKz6CUGmIkVde3O4LQC9Loda97XhU/edit?usp=sharing) to your Google Drive:

[![Google Sheet Screenshot](images/spreadsheet.png)](images/spreadsheet.png)

### Behat tests

[](#behat-tests)

Assuming you already have [Behat installed](http://behat.org/en/latest/quick_start.html#installation) via [Composer](https://getcomposer.org/)...

1. Install the Behat contexts:

    ```
    composer require --dev acquia/drupal-spec-tool
    ```
2. Add the new contexts to your [Behat configuration](http://behat.org/en/latest/user_guide/configuration.html), 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
    ```
3. Copy [the default feature files](../features) (representing the out-of-the-box configuration of Lightning) to your features directory. For example, given a [BLT](https://github.com/acquia/blt-behat)-based project:

    ```
    mkdir -p tests/behat/features/drupal-spec-tool
    cp vendor/acquia/drupal-spec-tool/features/*.feature tests/behat/features/drupal-spec-tool/
    ```
4. As you change the specification, update the features to match using the generated Gherkin on the "Behat" tab of the Google sheet. (See [Advanced](#advanced) below to automate this process.)
5. Run Behat! If the tests pass, your application matches the specification. If not, change one or the other according to your needs.

### Diagrams

[](#diagrams)

Diagrams aren't, strictly speaking, a feature of this package--which is focused on the Behat integration--but it's convenient to document them here. See [Diagrams](diagrams.md).

Usage
-----

[](#usage)

Learn more about the features of the tool and best practices for using it in [the announcement blog post on the Acquia Developer Center](https://docs.acquia.com/acquia-cloud-platform/help/88756-content-modeling-specification-tool).

Customization
-------------

[](#customization)

You can supplement or override out-of-the-box behavior by extending and replacing the default context classes with your own, e.g.:

```
namespace AcmeCorp;

class CustomContentModelContext extends Acquia\DrupalSpecTool\Context\ContentModelContext {

  /**
   * Override existing functionality.
   *
   * @Then exactly the following content entity type bundles should exist
   */
  public function assertBundles(TableNode $expected) {
    // ...
  }

  /**
   * Add new functionality.
   *
   * @Then something new should be true
   */
  public function assertSomethingNew(TableNode $expected) {
    // ...
  }

}
```

```
 # behat.yml
 default:
   suites:
     default:
       contexts:
-        - Acquia\DrupalSpecTool\Context\ContentModelContext
+        - AcmeCorp\CustomContentModelContext
```

Supporting tools
----------------

[](#supporting-tools)

The community has provided tools to build on the Drupal Spec Tool:

- [Drupal Spec Tool Commands](https://packagist.org/packages/nickwilde1990/drupal-spec-tool-commands) - Provides commands to automatically update the Google Sheet to match an existing Drupal site. This is helpful for adding the Drupal Spec Tool on a pre-existing project.
- [Drupal Entity Generator (DEG)](https://drupal-entity-generator.readthedocs.io/) - Automatically generates Drupal configuration based on the Google Sheet, i.e., goes "the other way" and updates your Drupal site to match your specification.

Known issues
------------

[](#known-issues)

[See open bug reports in the issue queue.](https://github.com/acquia/drupal-spec-tool/labels/bug)

Contribution
------------

[](#contribution)

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

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.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance55

Moderate activity, may be stable

Popularity58

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 92.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~149 days

Recently: every ~188 days

Total

16

Last Release

677d ago

Major Versions

v1.1 → v2.0.02018-07-17

v2.x-dev → v3.0.02019-12-06

v3.0.1 → 4.0.02020-06-24

4.1.1 → v5.0.02022-06-15

v5.0.0 → v6.0.0-alpha12023-01-19

PHP version history (7 changes)v1.0PHP ^5.6|^7.0

v2.x-devPHP ^5.6 || ^7.0

4.0.0PHP ^7.3

4.1.0PHP ^7.3 || ^8.0

v6.0.0-alpha1PHP ^8.1

v6.1.0PHP ^8.1|^8.2

v6.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c55ed0dc1d2e7df0158d61a56358e5299a38cdcc3728d513ce335382de9b94fe?d=identicon)[TravisCarden](/maintainers/TravisCarden)

![](https://avatars.githubusercontent.com/u/514789?v=4)[Acquia](/maintainers/acquia)[@acquia](https://github.com/acquia)

---

Top Contributors

[![TravisCarden](https://avatars.githubusercontent.com/u/959246?v=4)](https://github.com/TravisCarden "TravisCarden (162 commits)")[![platauto-bot[bot]](https://avatars.githubusercontent.com/in/1463154?v=4)](https://github.com/platauto-bot[bot] "platauto-bot[bot] (2 commits)")[![jfarrell](https://avatars.githubusercontent.com/u/770483?v=4)](https://github.com/jfarrell "jfarrell (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![mxr576](https://avatars.githubusercontent.com/u/1755573?v=4)](https://github.com/mxr576 "mxr576 (1 commits)")[![Raksha-Bharuka](https://avatars.githubusercontent.com/u/43320617?v=4)](https://github.com/Raksha-Bharuka "Raksha-Bharuka (1 commits)")[![secretsayan](https://avatars.githubusercontent.com/u/9529657?v=4)](https://github.com/secretsayan "secretsayan (1 commits)")[![mikemadison13](https://avatars.githubusercontent.com/u/22753451?v=4)](https://github.com/mikemadison13 "mikemadison13 (1 commits)")[![danielarendwtt](https://avatars.githubusercontent.com/u/143809794?v=4)](https://github.com/danielarendwtt "danielarendwtt (1 commits)")[![jhedstrom](https://avatars.githubusercontent.com/u/76833?v=4)](https://github.com/jhedstrom "jhedstrom (1 commits)")[![christopher-hopper](https://avatars.githubusercontent.com/u/452515?v=4)](https://github.com/christopher-hopper "christopher-hopper (1 commits)")

---

Tags

drupalBehat

### Embed Badge

![Health badge](/badges/acquia-drupal-spec-tool/health.svg)

```
[![Health](https://phpackages.com/badges/acquia-drupal-spec-tool/health.svg)](https://phpackages.com/packages/acquia-drupal-spec-tool)
```

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.1M147](/packages/drupal-drupal-extension)[nuvoleweb/drupal-behat

Drupal Behat extension.

33787.7k3](/packages/nuvoleweb-drupal-behat)[drupal/drupal-driver

A collection of reusable Drupal drivers

6715.8M18](/packages/drupal-drupal-driver)[dmore/behat-chrome-extension

Behat extension for controlling Chrome without Selenium

3313.2M358](/packages/dmore-behat-chrome-extension)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

214.8M28](/packages/acquia-coding-standards)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
