Behat Custom Helper
PHP Gherkin
Pull request Compare This branch is 3 commits behind Behatch:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
doc
i18n
src
tests
.atoum.php
.bootstrap.atoum.php
.gitignore
.scrutinizer.yml
.travis.yml
CONTRIBUTING.md
LICENSE
README.rst
behat.yml.dist
box.json
composer.json

README.rst

Behatch contexts

Build status Scrutinizer Code Quality Code Coverage SensioLabsInsight

Behatch contexts provide most common Behat tests.

Installation

This extension requires:

  • Behat 3+
  • Mink
  • Mink extension

Through PHAR

Download the .phar archives:

And activate it in your in your behat.yml:

# behat.yml
default:
    # ...
    extensions:
        behatch_contexts.phar: ~

Through Composer

The easiest way to keep your suite updated is to use Composer.

You can add Behatch contexts as dependencies for your project or rapidly bootstrap a Behatch projects.

Project dependency

  1. Install Composer
  2. Require the package with Composer:
$ composer require --dev behatch/contexts
  1. Activate extension by specifying its class in your behat.yml:
# behat.yml
default:
    # ...
    extensions:
        Sanpi\Behatch\Extension: ~

Project bootstraping

  1. Download the Behatch skeleton with composer:
$ php composer.phar create-project behatch/skeleton

Note

Browser, json, table and rest step need a mink configuration, see Mink extension for more information.

Usage

In behat.yml, enable desired contexts:

default:
    suites:
        default:
            contexts:
                - behatch:browser
                - behatch:debug
                - behatch:system
                - behatch:json
                - behatch:table
                - behatch:rest
                - behatch:xml

Configuration

  • browser - more browser related steps (like mink)
    • timeout - default timeout
  • debug - helper steps for debugging
    • screenshotDir - the directory where store screenshots
  • system - shell related steps
    • root - the root directory of the filesystem
  • json - JSON related steps
    • evaluationMode - javascript "foo.bar" or php "foo->bar"
  • table - play with HTML the tables

  • rest - send GET, POST, … requests and test the HTTP headers

  • xml - XML related steps

Translation

See more information on Transifex.com