Skip to content
Behat extension with most custom helper steps
Branch: master
Clone or download
sanpii Merge pull request #269 from PM-Connect/json-schema-windows
Fix json schema to allow relative schemas on Windows.
Latest commit bab9597 Jan 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fixtures/www/json Fix ability to test json payload against json schema Nov 8, 2017
i18n Dump command output Jul 25, 2018
src Fix json schema to allow relative schemas on Windows. Jan 15, 2019
tests Use @ instead of / Nov 30, 2018
.atoum.php Generate code coverage Apr 10, 2015
.bootstrap.atoum.php Simplify atoum configuration Apr 8, 2015
.gitignore Generate code coverage Apr 10, 2015
.scrutinizer.yml fix #163 Reset request headers after send Jul 4, 2017
.travis.yml Skips content type verification for php5.5 Mar 9, 2018
CONTRIBUTING.md Add contribution guidelines Apr 8, 2015
LICENSE Add LICENSE Jun 29, 2012
README.md Adds a note about examples May 15, 2018
UPGRADE-3.0.md Update UPGRADE-3.0.md Nov 8, 2017
UPGRADE-4.0.md
behat.yml.dist fix behat configuration #220 Jan 19, 2018
composer.json Requires behat/mink-extension ^2.3.1 Mar 9, 2018

README.md

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

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:
        Behatch\Extension: ~

Project bootstraping

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

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:context:browser
                - behatch:context:debug
                - behatch:context:system
                - behatch:context:json
                - behatch:context:table
                - behatch:context:rest
                - behatch:context:xml

Examples

This project is self-tested, you can explore the features directory to find some examples.

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

Configuration Example

For example, if you want to change default directory to screenshots - you can do it this way:

default:
    suites:
        default:
            contexts:
                - behatch:context:debug:
                    screenshotDir: "var"

Translation

See more information on Transifex.com

You can’t perform that action at this time.