PHPackages                             edmondscommerce/behat-html-context - 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. edmondscommerce/behat-html-context

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

edmondscommerce/behat-html-context
==================================

A Behat Extension for HTML

0.0.1(8y ago)4583[1 issues](https://github.com/edmondscommerce/behat-html-context/issues)1MITPHP

Since Mar 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/edmondscommerce/behat-html-context)[ Packagist](https://packagist.org/packages/edmondscommerce/behat-html-context)[ Docs](https://www.edmondscommerce.co.uk)[ RSS](/packages/edmondscommerce-behat-html-context/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (7)Versions (3)Used By (1)

Behat HTML Context
==================

[](#behat-html-context)

By [Edmonds Commerce](https://www.edmondscommerce.co.uk)
--------------------------------------------------------

[](#by-edmonds-commerce)

[![Codacy Badge](https://camo.githubusercontent.com/9946d622fca459bfa64669d0936dc13eedd1f8fde14f0bc3697401dd92d4d7e7/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6532613437623231396339333464336339336531356635616161343531383537)](https://www.codacy.com/app/edmondscommerce/behat-html-context?utm_source=github.com&utm_medium=referral&utm_content=edmondscommerce/behat-html-context&utm_campaign=Badge_Grade)

A simple Behat Context for working with HTML and navigation

### Installation

[](#installation)

Install via composer

```
"edmondscommerce/behat-html-context": "0.0.1"

```

### Include Context in Behat Configuration

[](#include-context-in-behat-configuration)

```
default:
    # ...
    suites:
        default:
            # ...
            contexts:
                - # ...
                - EdmondsCommerce\BehatHtmlContext\HTMLContext
                - EdmondsCommerce\BehatHtmlContext\RedirectionContext

```

> `EdmondsCommerce\BehatHtmlContext\RedirectionContext` is no longer supported and marked as deprecated.

Helper Methods
--------------

[](#helper-methods)

You will need to load the HTML context as part of your own suite of contexts using `@BeforeScenario` to access the helper methods

All helpers accept a custom message to use with the exception

```
// Instantiate context class,
$args = [
    'args' => [
        '--disable-gpu',
        '--window-size=1920,1080',
        '--start-maximised',
    ],
];

$driver = new Selenium2Driver('chrome', $args);
$session = new Behat\Mink\Session($driver);
$mink = new Mink(['selenium2' => $session]);

$htmlContext = new HTMLContext();
$htmlContext->setMink($mink);

//Find a node and return it or throw an exception
$htmlContext->findOneOrFail($selector, $locator, $message = null)

//Find multiple nodes and return an array of them or throw an exception if none are found
$htmlContext->findAllOrFail($selector, $locator, $message = null)

//Same as findOrFail but searches from the context of another node, can be useful for chaining
$htmlContext->findOrFailFromNode(\Behat\Mink\Element\NodeElement $element, $selector, $locator, $message = null)
```

Developer dependencies
----------------------

[](#developer-dependencies)

### edmondscommerce/phpqa

[](#edmondscommercephpqa)

Simple PHP QA pipeline and scripts, that helps achieving high quality of code. [Click here](https://github.com/edmondscommerce/phpqa) for more details.

### edmondscommerce/mock-server

[](#edmondscommercemock-server)

PHP Built-in web server. [Click here](https://github.com/edmondscommerce/mock-server) for more details.

### behat/mink-goutte-driver

[](#behatmink-goutte-driver)

Goutte driver. [Click here](https://github.com/minkphp/MinkGoutteDriver) for more details.

### behat/mink-selenium2-driver

[](#behatmink-selenium2-driver)

Selenium2 driver. [Click here](https://github.com/minkphp/MinkSelenium2Driver) for more details.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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

Unknown

Total

1

Last Release

3031d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7af407ceeb8622c9c164d386ef3e95cda4c94d141240348ac5703223bb499d0e?d=identicon)[edmondscommerce](/maintainers/edmondscommerce)

---

Top Contributors

[![edmondscommerce](https://avatars.githubusercontent.com/u/62842?v=4)](https://github.com/edmondscommerce "edmondscommerce (7 commits)")[![everon](https://avatars.githubusercontent.com/u/375251?v=4)](https://github.com/everon "everon (3 commits)")

---

Tags

testingbrowserlogginghtmlBehat

### Embed Badge

![Health badge](/badges/edmondscommerce-behat-html-context/health.svg)

```
[![Health](https://phpackages.com/badges/edmondscommerce-behat-html-context/health.svg)](https://phpackages.com/packages/edmondscommerce-behat-html-context)
```

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.7M172](/packages/drupal-drupal-extension)[behat/mink-browserkit-driver

Symfony2 BrowserKit driver for Mink framework

54464.9M345](/packages/behat-mink-browserkit-driver)[behat/mink-selenium2-driver

Selenium2 (WebDriver) driver for Mink framework

51960.3M717](/packages/behat-mink-selenium2-driver)[imbo/behat-api-extension

API extension for Behat

1092.6M9](/packages/imbo-behat-api-extension)[drevops/behat-steps

Collection of steps for Behat

27409.9k4](/packages/drevops-behat-steps)[robertfausk/behat-panther-extension

Symfony Panther extension for Behat

342.0M113](/packages/robertfausk-behat-panther-extension)

PHPackages © 2026

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