3

Hoping someone can help with this - I'm using Windows, not Mac. Self teaching, so don't have an expert to ask.

Got everything installed and I'm able to test .feature files using a php calculator (if I press 50 and then etc.)

I'd like to use it to test websites for fun.
My folder structure is:
C:\Behat\features
C:\Behat\vendor (where everything downloads to)
C:\Behat\behat.yml
C:\Behat\composer.json & .lock

Composer.json contains

"require": {
    "php":          ">=5.3.2",
    "behat/behat":  "~3.0,>=3.0.5",
    "behat/mink":   "~1.5",
    "symfony/config": "~2.2",
    "behat/mink-extension": "*",
    "behat/mink-goutte-driver": "*",
    "behat/mink-selenium2-driver": "*"
},

"require-dev": {
    "phpspec/phpspec":          "~2.0",
    "behat/mink-goutte-driver": "~1.1@dev"
},

"autoload": {
    "psr-0": { "Behat\\MinkExtension": "src/" }
},

The behat.yml file contains (one attempt)

default:
paths:
features: features
bootstrap: %behat.paths.features%/bootstrap
extensions:
Behat\MinkExtension:
  goutte: ~
  selenium2: ~

Another attempt

default:
suites:
my_suite:
  contexts:
    - FeatureContext
    - Behat\MinkExtension\Context\MinkContext
extensions:
Behat\MinkExtension:
  base_url:  'http://example.com'
  sessions:
    default:
      goutte: ~

Added "use Behat\MinkExtension\Context\MinkContext;" to the FeatureContext.php file
Also added the C:\Behat\vendor\bin to my PATH

But I always get this message when running behat

[Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException]
`Behat\MinkExtension` extension file or class could not be located.

Does anyone have any suggestions?

Websites that have helped others, but don't fix for me
stackoverflow question but they were missing the require
Not the same extension but didn't help with my .yml file
An old guide that didn't work for me either

Community
  • 1
  • 1
  • 1
    The autoload setting says that the Mink Extension sources are to be found in `C:\Behat\src` which is probably not the case. Was this generated by Composer? – Troublesometimes Sep 17 '15 at 17:12
  • @b263 You megastar! It wasn't generated by composer - I think it was an example one. I changed it to ` "autoload": { "psr-0": { "Behat\\MinkExtension": "vendor/behat/mink-extension/src/" } }, ` and it is working as expected now! – BeerFuelledDude Sep 21 '15 at 12:21

0 Answers0