Mink travis-ci Packagist phpunit

PHP 5.3 acceptance test framework for web applications

4 years after

Mink

Build Status

Usage Example

<?php

use Behat\Mink\Mink,
    Behat\Mink\Session,
    Behat\Mink\Driver\GoutteDriver,
    Behat\Mink\Driver\Goutte\Client as GoutteClient,
    Behat\Mink\Driver\SahiDriver;

$startUrl = 'http://example.com';

// init Mink and register sessions
$mink = new Mink(array(
    'goutte1'    => new Session(new GoutteDriver(GoutteClient($startUrl))),
    'goutte2'    => new Session(new GoutteDriver(GoutteClient($startUrl))),
    'javascript' => new Session(new SahiDriver('firefox')),
    'custom'     => new Session(new MyCustomDriver($startUrl))
));

// set default session name
$mink->setDefaultSessionName('goutte2');

// call getSession without argument will always return default session if has one (goutte2 here)
$mink->getSession()->getPage()->findLink('Downloads')->click();
echo $mink->getSession()->getPage()->getContent();

// run in javascript (Sahi) session
$mink->getSession('javascript')->getPage()->findLink('Downloads')->click();
echo $mink->getSession('javascript')->getPage()->getContent();

// run in custom session
$mink->getSession('custom')->getPage()->findLink('Downloads')->click();
echo $mink->getSession('custom')->getPage()->getContent();

// mix sessions
$mink->getSession('goutte1')->getPage()->findLink('Chat')->click();
$mink->getSession('goutte2')->getPage()->findLink('Chat')->click();

Install Dependencies

curl http://getcomposer.org/installer | php
php composer.phar install

Behat integration and translated languages

Behat integration altogether with translations have moved into separate project called MinkExtension. It's an extension to Behat 2.4. This will lead to much faster release cycles as MinkExtension doesn't have actual releases - any accepted PR about language translation or new step definitions will immediately go into live.

Copyright

Copyright (c) 2011 Konstantin Kudryashov (ever.zet). See LICENSE for details.

Contributors

Sponsors

Related Repositories

phpunit-mink

phpunit-mink

Library for using Mink in PHPUnit tests. Supports session sharing between tests ...

magento-mink

magento-mink

Test your Magento website with Behat Mink. ...

behat-mink-browserstack

behat-mink-browserstack

A feature context which sets up Mink for Browserstack ...

Behat-Mink-TestingBot

Behat-Mink-TestingBot

Behat, Mink and TestingBot ...

mink-page-objects

mink-page-objects

Implementation of Page Objects Pattern for Mink ...


Top Contributors

everzet alexandresalome b00giZm dcsg stof schmittjoh zombor jdreesen mdhooge proofek docteurklein radepal hidenorigoto asm89 anbotero robo47 djacquel gimler ThePixelDeveloper pgodel tawfekov giftnuss pete-otaqui arendjantetteroo benji07 clemherreman yegeniy ubermuda jakzal johnkary

Releases

-   v1.4.0 zip tar
-   v1.4.0beta5 zip tar
-   v1.4.0beta4 zip tar
-   v1.4.0beta3 zip tar
-   v1.4.0beta2 zip tar
-   v1.4.0beta1 zip tar
-   v1.3.4 zip tar
-   v1.3.3 zip tar
-   v1.3.2 zip tar
-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.0 zip tar
-   v1.1.1 zip tar
-   v1.1.0 zip tar
-   v1.0.4 zip tar
-   v1.0.3 zip tar
-   v1.0.2 zip tar
-   v1.0.1 zip tar
-   v1.0.0 zip tar
-   v0.3.2 zip tar
-   v0.3.1 zip tar
-   v0.3.0 zip tar
-   v0.2.4 zip tar
-   v0.2.3 zip tar
-   v0.2.2 zip tar
-   v0.2.1 zip tar
-   v0.2.0 zip tar
-   v0.1.2 zip tar
-   v0.1.1 zip tar
-   v0.1.0 zip tar