6

i'm trying to use mink with Behat on Zend framework 1 but when i run Behat command i get this error "Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (RuntimeException)"

here's my composer:

"behat/behat": "^3.0@dev",
"behat/mink": "1.5.*@stable",
"behat/mink-goutte-driver": "*",
"behat/mink-extension": "*"

&here's my behat.yml:

default:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://en.wikipedia.org
            goutte: ~

&here's my feature :

Feature: Search
   In order to see a word definition
   As a website user
   I need to be able to search for a word

  Scenario: Searching for a page that does exist
    Given I am on "/wiki/Main_Page"
    When I fill in "search" with "Behavior Driven Development"
    And I press "searchButton"
    Then I should see "agile software development"

& my FeatureContext.php:

<?php

use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\MinkContext;

class FeatureContext extends Behat\MinkExtension\Context\MinkContext
{
    public function __construct()
    {
    }
}
ahmed reda
  • 153
  • 2
  • 5
  • Your full example is [here](http://www.inanzzz.com/index.php/post/5rxn/taking-screenshots-of-failed-scenarios-in-behat3) – BentCoder Jul 26 '15 at 07:20

1 Answers1

5

In Behat 3 you should enable Behat\MinkExtension instead of Behat\MinkExtension\Extension

default:
    extensions:
        Behat\MinkExtension:
            base_url: http://en.wikipedia.org
            goutte: ~
Igor Lantushenko
  • 1,771
  • 10
  • 19