Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (RuntimeException)
Asked Answered
T

1

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()
    {
    }
}
Tybi answered 16/7, 2015 at 5:56 Comment(1)
Your full example is herePeterpeterborough
A
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: ~
Amberly answered 25/7, 2015 at 19:45 Comment(1)
@ahmed if this answer was usefull for you then you can upvote it.Amberly

© 2022 - 2024 — McMap. All rights reserved.