Closed walterdolce closed 4 years ago
I reverted to using Behat/Symfony2-Extension as with that everything works without problems.
That's an interesting case and very detailed report, thanks for that! Unfortunately, I don't have enough time in the nearest future to explore it.
If someone would like to help, creating a reproducer repo would make it even easier to start exploring this issue (https://symfony.com/doc/current/contributing/code/reproducer.html#reproducing-complex-bugs).
I have the same error once I started to extend the Behatch RestContext class
The issue with SensioLabs/BehatPageObjectExtension is that its Page constructor extends Mink's NodeElement, which calls methods on Mink's Session in the constructor, which in the end tries to initialize it way before SymfonyExtension could set current behat.service_container
instance.
Unless no change is made there, we won't be able to support it in SymfonyExtension. In Sylius, we use FriendsOfBehat/PageObjectExtension which is compatible with being registered as a service. I've added some tests in #105 to ensure it will not change.
Hi, I started using this extension after I was made aware https://github.com/Behat/Symfony2Extension is no longer supported.
I have the majority of my context classes referencing Page Object classes in their constructor. The Page Object extension I'm using is https://github.com/sensiolabs/BehatPageObjectExtension.
I have the typical
DemoContext
working fine. But the other context is not.I'm getting the following:
Folder structure is as follows:
This is the
AccountPageContext
class:This is the
behat.yml
configuration file:This is the
services_test.yaml
file:The page object class, is simply defined as follows:
And for completeness, this is the
autoload-dev
andrequire-dev
sections of thecomposer.json
file:When running
bin/behat -s demo
, everything should work just fine. When runningbin/behat -s accounts_management
, the same error should occur. I'm using Symfony 4 with Flex.Let me know if there's any additional information needed for this.