PHPackages                             drunomics/behat-drupal-utils - 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. drunomics/behat-drupal-utils

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

drunomics/behat-drupal-utils
============================

Provides behat step definitinons, contexts and utilities for using Behat with Drupal.

2.10.3(3y ago)243.9k↓33.3%1[1 PRs](https://github.com/drunomics/behat-drupal-utils/pulls)1GPL-2.0+PHP

Since Apr 30Pushed 3y agoCompare

[ Source](https://github.com/drunomics/behat-drupal-utils)[ Packagist](https://packagist.org/packages/drunomics/behat-drupal-utils)[ Docs](https://github.com/drunomics/behat-drupal-utils)[ RSS](/packages/drunomics-behat-drupal-utils/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (38)Used By (1)

drunomics Behat Drupal utils
============================

[](#drunomics-behat-drupal-utils)

Dependencies:
-------------

[](#dependencies)

- Behat
- Drupal
- Drupal Extension
- Behat Driver with Javascript enabled (e.g. `dmore/behat-chrome-extension`)

The javascript step definitions are all tested with `dmore/behat-chrome-extension`.

Overview:
---------

[](#overview)

The package provides:

- Various useful behat contexts, organized the following context classes:

    - DrupalUtilsApiContext
    - DrupalUtilsDrushContext
    - MinkUtilsContext
    - HttpHeadersContext

    Depending on your behat configuration, the suiting context classes should be added in. It automatically includes all compatible step definitions.
- Optional additional context classes that add automatic checks or cleanup routines like:

    - DrupalCleanTestContentApiContext
    - DrupalErrorCheckApiContext

Smoke tests
-----------

[](#smoke-tests)

The tests below ./examples/ ensure a simple Drupal login/logout works and a page of your site can be opened, while frontend assets are loaded and no javascript or watchdog errors are triggered.

### Setup

[](#setup)

- Add this package to your project's dev dependencies.
- Add one of the three context to your behat.yml, optionall also add optional contexts.
- Feel free to copy the example behat features.
- Add the provided js file to your sites js. The listener is required to catch js errors.

### Detecting watchdog errors

[](#detecting-watchdog-errors)

##### Default behaviour

[](#default-behaviour)

When DrupalErrorCheckApiContext is added, all watchdog entries excluding `Notice`, `Info` and `Debug` will be detected and trigger PHP errors in the behat PHP runner automatically.

##### Adjusting watchdog entries severity to `NOTICE` level

[](#adjusting-watchdog-entries-severity-to-notice-level)

To change the error detection severity to `NOTICE` set the `fail_on_notice` parameter in the behat.yml to `TRUE`.

```
contexts:
  - drunomics\BehatDrupalUtils\Context\DrupalErrorCheckApiContext:
      fail_on_notice: TRUE

```

Credits
-------

[](#credits)

developed by drunomics GmbH, Please refer to the commit log individual contributors.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~51 days

Recently: every ~147 days

Total

36

Last Release

1139d ago

Major Versions

1.x-dev → 2.0.02019-01-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/132232?v=4)[Wolfgang Ziegler](/maintainers/fago)[@fago](https://github.com/fago)

---

Top Contributors

[![fago](https://avatars.githubusercontent.com/u/132232?v=4)](https://github.com/fago "fago (33 commits)")[![pagachdrunomics](https://avatars.githubusercontent.com/u/45197243?v=4)](https://github.com/pagachdrunomics "pagachdrunomics (16 commits)")[![petarbasic](https://avatars.githubusercontent.com/u/52317999?v=4)](https://github.com/petarbasic "petarbasic (16 commits)")[![maximilianmikus](https://avatars.githubusercontent.com/u/1254146?v=4)](https://github.com/maximilianmikus "maximilianmikus (7 commits)")[![jeremychinquistdrunomicscom](https://avatars.githubusercontent.com/u/35216319?v=4)](https://github.com/jeremychinquistdrunomicscom "jeremychinquistdrunomicscom (3 commits)")[![ivangrozni](https://avatars.githubusercontent.com/u/3587288?v=4)](https://github.com/ivangrozni "ivangrozni (2 commits)")[![peterserfozo](https://avatars.githubusercontent.com/u/22172388?v=4)](https://github.com/peterserfozo "peterserfozo (2 commits)")[![rthideaway](https://avatars.githubusercontent.com/u/5792505?v=4)](https://github.com/rthideaway "rthideaway (1 commits)")[![mostepaniukvm](https://avatars.githubusercontent.com/u/15616007?v=4)](https://github.com/mostepaniukvm "mostepaniukvm (1 commits)")[![arthurlorenz](https://avatars.githubusercontent.com/u/11928191?v=4)](https://github.com/arthurlorenz "arthurlorenz (1 commits)")

---

Tags

behatdrupaldrupalBehatsmokesmoketestlogintest

### Embed Badge

![Health badge](/badges/drunomics-behat-drupal-utils/health.svg)

```
[![Health](https://phpackages.com/badges/drunomics-behat-drupal-utils/health.svg)](https://phpackages.com/packages/drunomics-behat-drupal-utils)
```

###  Alternatives

[acquia/drupal-spec-tool

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

1532.6M3](/packages/acquia-drupal-spec-tool)[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)

PHPackages © 2026

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