Skip to content

Commit 3aac569

Browse files
committed
Merge pull request #30 from stof/driver_doc
Improve the documentation of drivers
2 parents 69a7e45 + bea469c commit 3aac569

5 files changed

Lines changed: 86 additions & 11 deletions

File tree

drivers/goutte.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ GoutteDriver provides a bridge for the `Goutte`_ headless browser. Goutte
55
is a classical pure-php headless browser, written by the creator of the Symfony
66
framework Fabien Potencier.
77

8+
Installation
9+
------------
10+
11+
GoutteDriver is a pure PHP library available through Composer:
12+
13+
.. code-block:: bash
14+
15+
$ composer require behat/mink-goutte-driver
16+
17+
.. note::
18+
19+
GoutteDriver is compatible with both Goutte 1.x which relies on `Guzzle 3`_
20+
and Goutte 2.x which relies on `Guzzle 4+`_ for the underlying HTTP implementation.
21+
22+
Composer will probably select Goutte 2.x by default.
23+
24+
Usage
25+
-----
26+
827
In order to talk with Goutte, you should instantiate a
928
``Behat\Mink\Driver\GoutteDriver``:
1029

@@ -22,11 +41,6 @@ setup by hand:
2241
2342
$driver = new \Behat\Mink\Driver\GoutteDriver($client);
2443
25-
.. tip::
26-
27-
GoutteDriver is compatible with both Goutte 1.x which relies on `Guzzle 3`_
28-
and Goutte 2.x which relies on `Guzzle 4+`_ for the underlying HTTP implementation.
29-
3044
.. _Goutte: https://github.com/FriendsOfPHP/Goutte
3145
.. _Guzzle 3: http://guzzle3.readthedocs.org/en/latest/
3246
.. _Guzzle 4+: http://docs.guzzlephp.org/en/latest/

drivers/sahi.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ It's both easier to setup and to use than classical Selenium. It has a GUI
77
installer for each popular operating system out there and is able to control
88
every systems browser through a special bundled proxy server.
99

10+
Installation
11+
------------
12+
13+
SahiDriver is available through Composer:
14+
15+
.. code-block:: bash
16+
17+
$ composer require behat/mink-sahi-driver
18+
1019
In order to talk with a real browser through Sahi, you should install and
1120
configure Sahi first:
1221

@@ -22,6 +31,9 @@ configure Sahi first:
2231
cd $YOUR_PATH_TO_SAHI/bin
2332
./sahi.sh
2433
34+
Usage
35+
-----
36+
2537
After installing Sahi and running the Sahi proxy server, you will be able
2638
to control it with ``Behat\Mink\Driver\SahiDriver``:
2739

drivers/selenium.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ SeleniumDriver provides a bridge for the famous `Selenium`_ tool. If you
55
need legacy Selenium, you can use it right out of the box in your Mink test
66
suites.
77

8+
Installation
9+
------------
10+
11+
SeleniumDriver is available through Composer:
12+
13+
.. code-block:: bash
14+
15+
$ composer require behat/mink-selenium-driver
16+
817
In order to talk with the selenium server, you should install and configure
918
it first:
1019

@@ -17,6 +26,9 @@ it first:
1726
1827
$ java -jar selenium-server-standalone-2.44.0.jar
1928
29+
Usage
30+
-----
31+
2032
That's it, now you can use SeleniumDriver:
2133

2234
.. code-block:: php

drivers/selenium2.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Selenium2Driver
44
Selenium2Driver provides a bridge for the `Selenium2 (webdriver)`_ tool.
55
If you just love Selenium2, you can now use it right out of the box too.
66

7+
Installation
8+
------------
9+
10+
Selenium2Driver is available through Composer:
11+
12+
.. code-block:: bash
13+
14+
$ composer require behat/mink-selenium2-driver
15+
716
In order to talk with selenium server, you should install and configure it
817
first:
918

@@ -16,11 +25,25 @@ first:
1625
1726
$ java -jar selenium-server-standalone-2.44.0.jar
1827
28+
.. tip::
29+
30+
The Selenium2Driver actually relies on the WebDriver protocol defined
31+
by Selenium2. This means that it is possible to use it with other implementations
32+
of the protocol. Note however that other implementations may have some
33+
bugs.
34+
35+
The testsuite of the driver is run against the `Phantom.js implementation`_
36+
but it still triggers some failures because of bugs in their implementation.
37+
38+
Usage
39+
-----
40+
1941
That's it, now you can use Selenium2Driver:
2042

2143
.. code-block:: php
2244
2345
$driver = new \Behat\Mink\Driver\Selenium2Driver('firefox');
2446
47+
.. _Phantom.js implementation: http://phantomjs.org/
2548
.. _project website: http://seleniumhq.org/download/
2649
.. _Selenium2 (webdriver): http://seleniumhq.org/

drivers/zombie.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@ ZombieDriver
33

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

11-
In order to talk with zombie.js server, you should install and configure
12+
Installation
13+
------------
14+
15+
ZombieDriver is available through Composer:
16+
17+
.. code-block:: bash
18+
19+
$ composer require behat/mink-zombie-driver
20+
21+
In order to talk with a zombie.js server, you need to install and configure
1222
zombie.js first:
1323

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

17-
2. Install npm (node package manager) by following instructions from `<http://npmjs.org/>`_.
27+
2. Install npm (node package manager) by following the instructions from
28+
`<http://npmjs.org/>`_.
1829

1930
3. Install zombie.js with npm:
2031

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

45+
Usage
46+
-----
47+
3448
After that, you'll be able to just use ZombieDriver without manual server
3549
setup. The driver will do all that for you automatically:
3650

0 commit comments

Comments
 (0)