Closed bartonhammond closed 6 years ago
Is the extension enabled?
I did not do that...so I added the following to behat.yml
SensioLabs\Behat\PageObjectExtension:
namespaces:
page: ["%paths.base%/features/bootstrap/page-objects/page"]
Same error:
When I go to the "Home Page" page # HomeContext::iGoToThePage()
Fatal error: Call to a member function createPage() on null (Behat\Testwork\Call\Exception\FatalThrowableError)
@bartonhammond would you mind to put a simple project to github so i could reproduce? I think your problems are caused by misconfiguration, but I could use this opportunity to improve usability by providing better exception messages.
@jakzal will do. thanks for the suggestion.
I figured it out.
1) I was not extending my Context SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext
2) Changed behat.yml
by only adding this line: SensioLabs\Behat\PageObjectExtension: ~
. Before I tried to define the path to the page.
@bartonhammond that's great, I'm glad you fixed it!
My Context:
The Feature
behat.yml
My HomePage in
features/bootstrap/page-objects/page/HomePage.php
When I run
vendor/bin/behat --config behat.yml --colors --tags wip