You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# tests/Behat/AccountPageContext.php
<?php
namespace App\Tests\Behat;
use Behat\Behat\Context\Context;
use Page\Account;
final class AccountPageContext implements Context
{
private $account;
public function __construct(Account $account)
{
$this->account = $account;
}
# ...
When running bin/behat -s demo, everything should work just fine. When running bin/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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: