-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run after instalation #146
Comments
Same here - I was able to narrow down the culprit to |
@AntonioCS is your context definiton autoconfigured - |
I have this in
and this in
|
This is your main clue and your mistake
Just revert bundle registration to 'test' and run:
|
@udan this was |
@AntonioCS you can do this
it should give you your context:
If not, your services:
_defaults:
autowire: true
autoconfigure: true
App\Tests\Behat\:
resource: '../tests/Behat/*' |
@pamil I see you up voted. 😁 IMO this popping up again and again in the issues points to people not understanding how contexts are loaded. I had the same issue and needed to debug it, found out my test services weren't being loaded (a bug in Symfony IMO), saw that contexts which cannot be loaded from the container fall back to regular Behat behaviour. This might be too subtle and fragile, I'd make that opt in, but default to using only the container and erroring if not possible. This is very likely to remove most/all issues related to this misconfiguration. |
Move your Config to services.yml because services_test.yml ist never read by symfony because Behat runs in dev mode. |
Hello @AntonioCS, just encountered the same problem with Symfony 6.2.
Instead of
|
This works for me. Thanks |
Thanks @regisnew , your solution did work very well ! 🙏 |
Hey,
just followed this article here https://pavlakis.dev/posts/upgrade-to-friends-of-behat-symfony-extension/
to get behat up and running in symfony 4.
I ran the following commands:
I then run:
and I get the following error:
Not sure why this isn't using the test env but I went to
bundles.php
and changedtest
toall
inFriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['all' => true]
I ran the command again and got this error:
What am I doing wrong? I basically just installed this
The text was updated successfully, but these errors were encountered: