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 the following files cli.xml/domain.xml/hook.xml/setup.xml/transforms.xml/ui.xml in src/Openjet/Behat/Resources/config/services/contexts/ folder:
<service id="openjet.behat.context.CONTEXT_CATEGORY.CONTEXT_NAME" class="%openjet.behat.context.CONTEXT_CATEGORY.CONTEXT_NAME.class%" scope="scenario">
<tag name="fob.context_service" />
</service>
Then you can use it in your suite configuration:
default:
suites:
SUITE_NAME:
contexts_services:
- "openjet.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.