PHPackages                             digitalist-se/behat-tools - 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. digitalist-se/behat-tools

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

digitalist-se/behat-tools
=========================

Behat tools

v2.0.5(2mo ago)015.0k↓35.8%GPL-3.0PHPPHP &gt;=7.2

Since Jul 16Pushed 2mo ago19 watchersCompare

[ Source](https://github.com/digitalist-se/behat-tools)[ Packagist](https://packagist.org/packages/digitalist-se/behat-tools)[ RSS](/packages/digitalist-se-behat-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (28)Used By (0)

behat-tools
===========

[](#behat-tools)

Behat related tools

Set up
------

[](#set-up)

Add this to the `repositories` section of your `composer.json`

```
        {
            "type": "vcs",
            "url": "https://github.com/digitalist-se/behat-tools"
        },
```

Execute:

```
composer require --dev digitalist-se/behat-tools
```

Add to your `behat.yml`:

```
default:
  suites:
    default:
      contexts:
        - digitalistse\BehatTools\Context\CommonContext
```

Add more Contexts depending on your needs using the same structure.

Entity Context
==============

[](#entity-context)

You can set the format of the dates for each field in the behat.yml like this:

```
default:
  suites:
    default:
      parameters:
        entity_context:
          datetime_format:
            announcement:
              publish_date: 'Y-m-d'
              unpublish_date: 'Y-m-d'
            announcement_tracker:
              created_date: 'Y-m-d\TH:i:s'
              sent_date: 'Y-m-d\TH:i:s'
              read_date: 'Y-m-d\TH:i:s'
```

In that case you could use relative date in php format like:

```
Given a "license_tracker" entity exists with the properties:
      | label | status | uid:user:mail       | field_license:license:title | created     | activated   | expire  | first_notification | second_notification | service_requirement_expired |
      | TRK10 | 1      | license-01@test.com | Test license 1              | 6 month ago | 6 month ago | 91 days | tomorrow           | 61 days             | tomorrow                    |
      | TRK10 | 1      | license-02@test.com | Test license 1              | 6 month ago | 6 month ago | 90 days | today              | 60 days             | tomorrow                    |
      | TRK10 | 1      | license-03@test.com | Test license 1              | 6 month ago | 6 month ago | 89 days | yesterday          | 59 days             | tomorrow                    |
```

**Entity fields support**

Entity fields are supported like in the following example: `() .`

- Field with simple structure (e.g.: boolean, textfield, etc.): `field_archived.value`
- Field type with more complex structure: `(daterange) field_date.value`

> NOTE: Only `daterange` type is supported at the moment. If you need to support more complex fields you can add processing to `EntityContext::processEntityFields`.

Example using entity fields and properties

```
Given a "license_tracker" entity exists with the properties:
      | label | status | uid:user:mail       | field_archived.value | (daterange) field_date.value | (daterange) field_date.end_value |
      | TRK10 | 1      | license-01@test.com | 1                    | 6 month ago                  | 6 month ago                      |
      | TRK10 | 1      | license-02@test.com | 0                    | 6 month ago                  | 6 month ago                      |
      | TRK10 | 1      | license-03@test.com | 1                    | 6 month ago                  | 6 month ago                      |
```

Screenshot Context
==================

[](#screenshot-context)

The `ScreenshotContext` needs display sizes declared in your `behat.yml` under the suite settings key `screenshot_context`. Define a desktop size and any number of named mobile devices to ensure predictable, comparable screenshots.

Recommended configuration:

```
default:
  suites:
    default:
      contexts:
        - digitalistse\BehatTools\Context\ScreenshotContext
      screenshot_context:
        screenshot_path: '%paths.base%/screenshots-build'   # required
        desktop_size:                                       # strongly recommended
          width: 1920
          height: 1080
        mobile_devices:                                     # optional, add any devices you want
          iphone8:
            width: 375
            height: 667
          ipad:
            width: 768
            height: 1024
        desktop_subfolder: 'desktop'                        # optional (default: desktop)
        mobile_subfolder: 'mobile'                          # optional (default: mobile)
```

Notes:

- One desktop screenshot is always taken using `desktop_size` (defaults to 1920x1080 if not set).
- One additional screenshot is taken per entry in `mobile_devices`, saved under the `mobile_subfolder` using the device name in the filename.
- If no `mobile_devices` are configured, only the desktop screenshot is produced.

Legacy configuration (backwards compatibility):

```
default:
  suites:
    default:
      screenshot_context:
        screenshot_path: '%paths.base%/screenshots-build'
        display_sizes:
          desktop:
            width: 1920
            height: 1080
          mobile:
            width: 375
            height: 667
```

When using `display_sizes`, the desktop size is read from `display_sizes.desktop`, and a single mobile device named `mobile` is inferred from `display_sizes.mobile`. Other keys (e.g. `tablet`) are ignored by the current implementation. Prefer the recommended `desktop_size` + `mobile_devices` format for multiple devices.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance86

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% 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 ~82 days

Recently: every ~48 days

Total

26

Last Release

71d ago

Major Versions

v0.0.4 → 1.0.02024-03-07

1.0.15 → 2.0.02025-08-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab5d6537b6884dea5af31eebe7d0a19554b2810a2f1e0034ba2f6349182152b8?d=identicon)[se.support](/maintainers/se.support)

---

Top Contributors

[![jjcarrion](https://avatars.githubusercontent.com/u/1206328?v=4)](https://github.com/jjcarrion "jjcarrion (30 commits)")[![isaacrodriguezcubells](https://avatars.githubusercontent.com/u/26286298?v=4)](https://github.com/isaacrodriguezcubells "isaacrodriguezcubells (7 commits)")[![borutpiletic](https://avatars.githubusercontent.com/u/2700509?v=4)](https://github.com/borutpiletic "borutpiletic (5 commits)")

---

Tags

BDDContextBehatDrupal 8

### Embed Badge

![Health badge](/badges/digitalist-se-behat-tools/health.svg)

```
[![Health](https://phpackages.com/badges/digitalist-se-behat-tools/health.svg)](https://phpackages.com/packages/digitalist-se-behat-tools)
```

###  Alternatives

[soyuka/contexts

Behatch contexts

282.1M11](/packages/soyuka-contexts)[novaway/common-contexts

Novaway Behat common contexts

18187.8k3](/packages/novaway-common-contexts)[dmarynicz/behat-parallel-extension

Parallel extension for Behat

27544.3k](/packages/dmarynicz-behat-parallel-extension)[marcortola/behat-seo-contexts

Behat extension for testing some On-Page SEO factors: meta title/description, canonical, hreflang, meta robots, robots.txt, redirects, sitemap validation, HTML validation, performance...

13153.8k](/packages/marcortola-behat-seo-contexts)[macpaw/behat-messenger-context

Behat Context for testing Symfony Messenger component

16232.9k](/packages/macpaw-behat-messenger-context)[polishsymfonycommunity/symfony2-mocker-extension

Behat extension for mocking services defined in the Symfony2 dependency injection container.

26253.1k4](/packages/polishsymfonycommunity-symfony2-mocker-extension)

PHPackages © 2026

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