PHPackages                             seec/behat-test-runner - 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. seec/behat-test-runner

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

seec/behat-test-runner
======================

Component to help in self testing Behat extension development

8.2.5(2y ago)01381MITPHPPHP ^7.4|^8.0

Since Jun 24Pushed 2y agoCompare

[ Source](https://github.com/bytes-max/behat-test-runner)[ Packagist](https://packagist.org/packages/seec/behat-test-runner)[ Docs](https://github.com/nopenopenope/behat-test-runner)[ RSS](/packages/seec-behat-test-runner/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (10)Versions (14)Used By (1)

Behat Test Runner
=================

[](#behat-test-runner)

[![CI](https://github.com/nopenopenope/behat-test-runner/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/nopenopenope/behat-test-runner/actions/workflows/ci.yml)

Behat Test Runner is essentially a Behat context class which provides steps for testing a Behat extension. You can put together a feature file and behat.yml configuration, than the test runner will start a second Behat process to evaluate the created feature file. This a fork of the original test suite which is used in the Magento2 Behat Extension. Differently to the original version, this fork is *not* supporting outdated PHP versions with the exception of PHP 7.4 and many projects still running on it.

Installation
------------

[](#installation)

Install by adding to your `composer.json`:

```
composer require --dev seec/behat-test-runner
```

Configuration
-------------

[](#configuration)

Include the context file in `behat.yml` like this:

```
default:
  suites:
    default:
      contexts:
        - SEEC\BehatTestRunner\Context\TestRunnerContext
```

You can configure the working directory like this (optional):

```
default:
  suites:
    default:
      contexts:
        - SEEC\BehatTestRunner\Context\TestRunnerContext:
            workingDirectory: path/to/your/working/dir # if not provided then a temporary working dir is autogenerated
```

Usage
-----

[](#usage)

Simply use the necessary steps from the context file to put together your feature.

An example:

```
Feature: Visiting a page on the website
  In order to demonstrate how to use test runner
  As a developer
  I should open a page and verify the content of it

  Background:
    Given I have the file "index.html" in document root:
            """

                  Test page

                  Lorem ipsum dolor amet.

            """
    And I have a web server running on host "localhost" and port "8080"
    And I have the feature:
            """
            Feature: Test runner demo feature
              Scenario:
                Given I open the index page
                Then I should see the content "Lorem ipsum" on the page in a h1 HTML tag
            """
    And I have the context:
            """
