Little words in doc
This commit is contained in:
@@ -2,8 +2,8 @@ Mink Extension
|
|||||||
==============
|
==============
|
||||||
|
|
||||||
You can use Behat to describe anything, that you can describe in business
|
You can use Behat to describe anything, that you can describe in business
|
||||||
logic. It’s tools, gui applications, web applications. Most interesting part
|
logic. It’s tools, gui applications, web applications. The most interesting part
|
||||||
is web applications. First, behavioral testing already exists in web world -
|
is web applications. First, behavioral testing already exists in the web world -
|
||||||
it’s called functional or acceptance testing. Almost all popular frameworks
|
it’s called functional or acceptance testing. Almost all popular frameworks
|
||||||
and languages provide functional testing tools. Today we’ll talk about how to
|
and languages provide functional testing tools. Today we’ll talk about how to
|
||||||
use Behat for functional testing of web applications. `Mink <http://mink.behat.org>`_
|
use Behat for functional testing of web applications. `Mink <http://mink.behat.org>`_
|
||||||
@@ -13,7 +13,7 @@ Basically, MinkExtension is an integration layer between Behat 3.0+ and Mink 1.4
|
|||||||
and it provides:
|
and it provides:
|
||||||
|
|
||||||
* Additional services for Behat (``Mink``, ``Sessions``, ``Drivers``).
|
* Additional services for Behat (``Mink``, ``Sessions``, ``Drivers``).
|
||||||
* ``Behat\MinkExtension\Context\MinkAwareContext`` which provides ``Mink``
|
* ``Behat\MinkExtension\Context\MinkAwareContext`` which provides a ``Mink``
|
||||||
instance for your contexts.
|
instance for your contexts.
|
||||||
* Base ``Behat\MinkExtension\Context\MinkContext`` context which provides base
|
* Base ``Behat\MinkExtension\Context\MinkContext`` context which provides base
|
||||||
step definitions and hooks for your contexts or subcontexts. Or it could be
|
step definitions and hooks for your contexts or subcontexts. Or it could be
|
||||||
@@ -38,7 +38,7 @@ The easiest way to keep your suite updated is to use `Composer <http://getcompos
|
|||||||
|
|
||||||
$ composer require --dev behat/mink-extension
|
$ composer require --dev behat/mink-extension
|
||||||
|
|
||||||
2. Activate extension by specifying its class in your ``behat.yml``:
|
2. Activate the extension by specifying its class in your ``behat.yml``:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@@ -55,10 +55,10 @@ The easiest way to keep your suite updated is to use `Composer <http://getcompos
|
|||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
After installing extension, there would be 6 usage options available for you:
|
After installing the extension, there are 4 usage options available:
|
||||||
|
|
||||||
1. Extending ``Behat\MinkExtension\Context\RawMinkContext`` in your feature suite.
|
1. Extending ``Behat\MinkExtension\Context\RawMinkContext`` in your feature suite.
|
||||||
This will give you ability to use a preconfigured `Mink` instance altogether with some
|
This will give you the ability to use a preconfigured `Mink` instance with some
|
||||||
convenience methods:
|
convenience methods:
|
||||||
|
|
||||||
* ``getSession($name = null)``
|
* ``getSession($name = null)``
|
||||||
@@ -95,8 +95,8 @@ After installing extension, there would be 6 usage options available for you:
|
|||||||
It will cause a ``RedundantException``. So, you can inherit from ``MinkContext``
|
It will cause a ``RedundantException``. So, you can inherit from ``MinkContext``
|
||||||
only with one of your context/subcontext classes.
|
only with one of your context/subcontext classes.
|
||||||
|
|
||||||
3. Adding ``Behat\MinkExtension\Context\MinkContext`` as context in your suite.
|
3. Adding ``Behat\MinkExtension\Context\MinkContext`` as a context in your suite.
|
||||||
Exactly like previous option, but gives you the ability to keep your main context
|
Exactly like the previous option, but gives you the ability to keep your main context
|
||||||
class clean.
|
class clean.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
@@ -151,8 +151,8 @@ MinkExtension will set the default Mink session for each scenario based on
|
|||||||
the configuration settings ``default_session`` and ``javascript_session``
|
the configuration settings ``default_session`` and ``javascript_session``
|
||||||
and on scenario tags:
|
and on scenario tags:
|
||||||
|
|
||||||
* A scenario tagged with ``@mink:foo`` will use ``foo`` as default session;
|
* A scenario tagged with ``@mink:foo`` will use ``foo`` as its default session;
|
||||||
* A scenario tagged with ``@javascript`` will use the javascript session as default session;
|
* A scenario tagged with ``@javascript`` will use the javascript session as its default session;
|
||||||
* Other scenarios will use the default session.
|
* Other scenarios will use the default session.
|
||||||
|
|
||||||
The default session and the default javascript session can also be configured for
|
The default session and the default javascript session can also be configured for
|
||||||
@@ -193,7 +193,7 @@ with support for 7 drivers out of the box:
|
|||||||
goutte: ~
|
goutte: ~
|
||||||
|
|
||||||
.. Tips : HTTPS and self-signed certificate
|
.. Tips : HTTPS and self-signed certificate
|
||||||
In case you use Behat/Mink/Goutte to test your application, and want to test an
|
If you use Behat/Mink/Goutte to test your application, and want to test an
|
||||||
application secured with HTTPS, but with a self-signed certificate, you can use
|
application secured with HTTPS, but with a self-signed certificate, you can use
|
||||||
the following parameters to avoid the validation error triggered by Guzzle:
|
the following parameters to avoid the validation error triggered by Guzzle:
|
||||||
|
|
||||||
@@ -315,7 +315,7 @@ with support for 7 drivers out of the box:
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
All drivers share the same API, which means that you could use multiple drivers
|
All drivers share the same API, which means that you could use multiple drivers
|
||||||
for the same suite - which one fits your needs for concrete scenarios. Don't
|
for the same suite - whichever one fits your needs for concrete scenarios. Don't
|
||||||
try to stick to a single driver as there's simply no universal solution - every
|
try to stick to a single driver as there's simply no universal solution - every
|
||||||
driver has its pros and cons.
|
driver has its pros and cons.
|
||||||
|
|
||||||
@@ -329,10 +329,10 @@ There's other useful parameters, that you can use to configure your suite:
|
|||||||
for them.
|
for them.
|
||||||
* ``files_path`` - there's a special step definition for file upload inputs
|
* ``files_path`` - there's a special step definition for file upload inputs
|
||||||
usage. You can use relative paths in those steps. ``files_path`` defines
|
usage. You can use relative paths in those steps. ``files_path`` defines
|
||||||
base path in which Mink should search those relative files.
|
the base path in which Mink should search for those relative files.
|
||||||
* ``show_cmd`` - there's a special definition in MinkExtension, that saves
|
* ``show_cmd`` - there's a special definition in MinkExtension, that saves
|
||||||
currently opened page into temporary file and opens it with some browser
|
the currently opened page into a temporary file and opens it with some browser
|
||||||
utility (for debugging). This option defines command to be used for opening.
|
utility (for debugging). This option defines the command to be used for opening.
|
||||||
For example: ``show_cmd: 'firefox %s'``.
|
For example: ``show_cmd: 'firefox %s'``.
|
||||||
* ``show_tmp_dir`` - the temporary folder used to show the opened page (defaults
|
* ``show_tmp_dir`` - the temporary folder used to show the opened page (defaults
|
||||||
to the system temp dir)
|
to the system temp dir)
|
||||||
@@ -340,10 +340,10 @@ There's other useful parameters, that you can use to configure your suite:
|
|||||||
a step fails.
|
a step fails.
|
||||||
* ``browser_name`` - meta-option, that defines which browser to use for Sahi,
|
* ``browser_name`` - meta-option, that defines which browser to use for Sahi,
|
||||||
Selenium and Selenium2 drivers.
|
Selenium and Selenium2 drivers.
|
||||||
* ``default_session`` - defines default session (driver) to be used for all
|
* ``default_session`` - defines the default session (driver) to be used for all
|
||||||
untagged scenarios. Could be any enabled session name.
|
untagged scenarios. This could be any enabled session name.
|
||||||
* ``javascript_session`` - defines javascript session (driver) (the one, which
|
* ``javascript_session`` - defines the javascript session (driver) (the one, which
|
||||||
will be used for ``@javascript`` tagged scenarios). Could be any enabled session
|
will be used for ``@javascript`` tagged scenarios). This could be any enabled session
|
||||||
name.
|
name.
|
||||||
* ``mink_loader`` - path to a file loaded to make Mink available (useful when
|
* ``mink_loader`` - path to a file loaded to make Mink available (useful when
|
||||||
using the PHAR archive for Mink, useless when using Composer)
|
using the PHAR archive for Mink, useless when using Composer)
|
||||||
|
|||||||
Reference in New Issue
Block a user