Skip to content

Commit

Permalink
Merge pull request #30 from stof/driver_doc
Browse files Browse the repository at this point in the history
Improve the documentation of drivers
  • Loading branch information
stof committed Jan 7, 2015
2 parents 69a7e45 + bea469c commit 3aac569
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 11 deletions.
24 changes: 19 additions & 5 deletions drivers/goutte.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ GoutteDriver provides a bridge for the `Goutte`_ headless browser. Goutte
is a classical pure-php headless browser, written by the creator of the Symfony
framework Fabien Potencier.

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

GoutteDriver is a pure PHP library available through Composer:

.. code-block:: bash
$ composer require behat/mink-goutte-driver
.. note::

GoutteDriver is compatible with both Goutte 1.x which relies on `Guzzle 3`_
and Goutte 2.x which relies on `Guzzle 4+`_ for the underlying HTTP implementation.

Composer will probably select Goutte 2.x by default.

Usage
-----

In order to talk with Goutte, you should instantiate a
``Behat\Mink\Driver\GoutteDriver``:

Expand All @@ -22,11 +41,6 @@ setup by hand:
$driver = new \Behat\Mink\Driver\GoutteDriver($client);
.. tip::

GoutteDriver is compatible with both Goutte 1.x which relies on `Guzzle 3`_
and Goutte 2.x which relies on `Guzzle 4+`_ for the underlying HTTP implementation.

.. _Goutte: https://github.com/FriendsOfPHP/Goutte
.. _Guzzle 3: http://guzzle3.readthedocs.org/en/latest/
.. _Guzzle 4+: http://docs.guzzlephp.org/en/latest/
12 changes: 12 additions & 0 deletions drivers/sahi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ It's both easier to setup and to use than classical Selenium. It has a GUI
installer for each popular operating system out there and is able to control
every systems browser through a special bundled proxy server.

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

SahiDriver is available through Composer:

.. code-block:: bash
$ composer require behat/mink-sahi-driver
In order to talk with a real browser through Sahi, you should install and
configure Sahi first:

Expand All @@ -22,6 +31,9 @@ configure Sahi first:
cd $YOUR_PATH_TO_SAHI/bin
./sahi.sh
Usage
-----

After installing Sahi and running the Sahi proxy server, you will be able
to control it with ``Behat\Mink\Driver\SahiDriver``:

Expand Down
12 changes: 12 additions & 0 deletions drivers/selenium.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ SeleniumDriver provides a bridge for the famous `Selenium`_ tool. If you
need legacy Selenium, you can use it right out of the box in your Mink test
suites.

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

SeleniumDriver is available through Composer:

.. code-block:: bash
$ composer require behat/mink-selenium-driver
In order to talk with the selenium server, you should install and configure
it first:

Expand All @@ -17,6 +26,9 @@ it first:
$ java -jar selenium-server-standalone-2.44.0.jar
Usage
-----

That's it, now you can use SeleniumDriver:

.. code-block:: php
Expand Down
23 changes: 23 additions & 0 deletions drivers/selenium2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Selenium2Driver
Selenium2Driver provides a bridge for the `Selenium2 (webdriver)`_ tool.
If you just love Selenium2, you can now use it right out of the box too.

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

Selenium2Driver is available through Composer:

.. code-block:: bash
$ composer require behat/mink-selenium2-driver
In order to talk with selenium server, you should install and configure it
first:

Expand All @@ -16,11 +25,25 @@ first:
$ java -jar selenium-server-standalone-2.44.0.jar
.. tip::

The Selenium2Driver actually relies on the WebDriver protocol defined
by Selenium2. This means that it is possible to use it with other implementations
of the protocol. Note however that other implementations may have some
bugs.

The testsuite of the driver is run against the `Phantom.js implementation`_
but it still triggers some failures because of bugs in their implementation.

Usage
-----

That's it, now you can use Selenium2Driver:

.. code-block:: php
$driver = new \Behat\Mink\Driver\Selenium2Driver('firefox');
.. _Phantom.js implementation: http://phantomjs.org/
.. _project website: http://seleniumhq.org/download/
.. _Selenium2 (webdriver): http://seleniumhq.org/
26 changes: 20 additions & 6 deletions drivers/zombie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@ ZombieDriver

ZombieDriver provides a bridge for the `Zombie.js`_ browser emulator. Zombie.js
is a headless browser emulator, written in node.js. It supports all JS interactions
that Sahi and Selenium do and works almost as fast as Goutte does.
It's best of both worlds, actually, but still limited to only one browser
type (Webkit). Also it's still slower than Goutte and requires node.js and
npm to be installed on the system.
that :doc:`Selenium </drivers/selenium2>` and :doc:`Sahi </drivers/sahi>`
do and works almost as fast as Goutte does. It is the best of both worlds
actually, but still limited to only one browser type (Webkit). Also it is
still slower than Goutte and requires node.js and npm to be installed on
the system.

In order to talk with zombie.js server, you should install and configure
Installation
------------

ZombieDriver is available through Composer:

.. code-block:: bash
$ composer require behat/mink-zombie-driver
In order to talk with a zombie.js server, you need to install and configure
zombie.js first:

1. Install node.js by following instructions from the official site:
`<http://nodejs.org/>`_.

2. Install npm (node package manager) by following instructions from `<http://npmjs.org/>`_.
2. Install npm (node package manager) by following the instructions from
`<http://npmjs.org/>`_.

3. Install zombie.js with npm:

Expand All @@ -31,6 +42,9 @@ The easiest way to do this is to add:
into your ``.bashrc``.

Usage
-----

After that, you'll be able to just use ZombieDriver without manual server
setup. The driver will do all that for you automatically:

Expand Down

0 comments on commit 3aac569

Please sign in to comment.