Installed BeHat on Windows 7 but getting an error trying to run behat or behat --init
By : onecrazyangel
Date : March 29 2020, 07:55 AM
hope this fix your issue Use composer to install Behat ( v2 or v3). Pear channel is no longer maintained and you can only install old versions with it (up to 2.3.5, so no >2.5 or 3.0).
|
Class 'Behat\Behat\Context\BehatContext' not found in PHP with Behat
By : Abhi
Date : March 29 2020, 07:55 AM
help you fix your problem It appears you've installed Behat v3, but you're following Behat 2 docs. Behat 3 code :
use Behat\Behat\Context\Context;
class FeatureContext implements Context
{
// ...
}
{
"require-dev": {
"behat/behat": "~3.1"
},
"config": {
"bin-dir": "bin/"
}
}
use Behat\Behat\Context\BehatContext;
class FeatureContext extends BehatContext
{
// ...
}
{
"require-dev": {
"behat/behat": "~2.5"
},
"config": {
"bin-dir": "bin/"
}
}
|
Behat reading default .env file and not .env.behat in Laravel 5
By : user3428656
Date : March 29 2020, 07:55 AM
it should still fix some issue If you are using Laravel Homestead, the issue isn't with it reading the .env file, more that it is reading it from the default APP_ENV set in your homestead.yaml file. Take the APP_ENV variable out of your homestead.yaml file and then re-provision your homestead box and it should work fine. These are the offending lines in your homestead.yaml: code :
- key: APP_ENV
value: local
|
Testing multi-tenancy Laravel applications using Behat / Mink and Behat Laravel Extension
By : theotuck
Date : March 29 2020, 07:55 AM
I wish did fix the issue. After a short while I revisited this problem and found a rather simple solution to be used in my FeatureContext.php: code :
$this->setMinkParameter('base_url', $url);
/**
* @Given I visit the url :url
*/
public function visitDomain($url)
{
$this->setMinkParameter('base_url', $url);
$this->visit('/');
}
Scenario: Test Multi Tenancy
Given I have a business "mttest"
When I visit the url "http://mttest.example.com"
Then I should see "mttest"
|
Behat test error after upgrade to Behat 3.3.1 - Too few arguments to function FeatureContext
By : Encoding.com
Date : March 29 2020, 07:55 AM
should help you out It turned out, a part of my configuration was missing from behat.yml file. The part was missing: code :
SensioLabs\Behat\PageObjectExtension:
namespaces:
page: Page
element: Page\Element
|