How can I run behat --init -s bugfix
to generate Context files inside the Bundle? Is there any way to do this? I see the Sf2DemoBundle
but I didn't solve how it works.
My files
# /composer.json
"behat/behat": "dev-master",
"behat/mink": "dev-master",
"behat/mink-extension": "dev-master",
"behat/symfony2-extension": "dev-master",
"behat/mink-goutte-driver": "dev-master",
"behat/mink-browserkit-driver": "dev-master",
"behat/mink-selenium2-driver": "dev-master",
# /behat.yml
default:
suites:
default:
path: %paths.base%/features
contexts: [Behat\MinkExtension\Context\MinkContext]
bugfix:
type: symfony_bundle
bundle: 'TestBugfixBundle'
contexts: ['TestBugfixBundle\Features\Context\WebContext']
extensions:
Behat\Symfony2Extension: ~
Behat\MinkExtension:
default_session: 'symfony2'
sessions:
symfony2:
symfony2: ~
You must set the autoload
parameter to behat:
# /behat.yml
default:
autoload:
'': %paths.base%/src
Your solution is fine, but you can also move your context files to the bundle Feature directory (src/Acme/DemoBundle/Features/Context
for instance) and it will work right off the bat.
No need then to add any configuration in behat.yml
(no autoload
entry is necessary).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With