mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
27 lines
975 B
ReStructuredText
27 lines
975 B
ReStructuredText
How to add a new context?
|
|
=========================
|
|
|
|
To add a new context to Behat container it is needed to add a service in to one of a following files ``cli.xml``/``domain.xml``/``hook.xml``/``setup.xml``/``transform.xml``/``ui.xml`` in ``src/Sylius/Behat/Resources/config/services/contexts/`` folder:
|
|
|
|
.. code-block:: xml
|
|
|
|
<service id="sylius.behat.context.CONTEXT_CATEGORY.CONTEXT_NAME"
|
|
class="%sylius.behat.context.CONTEXT_CATEGORY.CONTEXT_NAME.class%"
|
|
public="true" />
|
|
|
|
Then you can use it in your suite configuration:
|
|
|
|
.. code-block:: yaml
|
|
|
|
default:
|
|
suites:
|
|
SUITE_NAME:
|
|
contexts:
|
|
- "sylius.behat.context.CONTEXT_CATEGORY.CONTEXT_NAME"
|
|
|
|
filters:
|
|
tags: "@SUITE_TAG"
|
|
|
|
.. note::
|
|
|
|
The context categories are usually one of ``hook``, ``setup``, ``ui`` and ``domain`` and, as you can guess, they are corresponded to files name mentioned above.
|