FAQ Database Discussion Community


Behat does not recognize a defined step

php,behat,mink
I am having an issue with Behat and Mink. When running I am being prompted to add a #2 to my function declaration. Here is my composer file for version info { "require": { "behat/behat": "2.5.*@stable", "behat/mink": "~1.6", "behat/mink-extension": "~1.0", "behat/mink-goutte-driver": "~1.1", "fabpot/goutte": "~1.0.4", "behat/mink-selenium2-driver": "*" }, "config": { "bin-dir":...

PHP, BDD with Behat and Mink (Selenium2 driver): How to close the browser window at the end of the test programatically?

php,selenium-webdriver,bdd,behat,mink
I am trying to learn BDD in PHP with Behat and Mink and I am using Selenium2 driver for the same. My question is once the tests are over, how to programmatically close each browser window/tab that Selenium2 opens? Since closing so many browser windows/tabs each time after each test...

Behat 3 with Laravel 5: acceptance test passes but it should not

php,laravel-5,behat,mink
I'm doing my firsts acceptance tests for a Laravel 5 application using Behat 3 and Mink. The application runs under a Homestead VM. The test is straightforward and is located in the features/example.feature file. This is the test: Feature: Sample In order to learn Behat As a programmer I need...

There is no element matching XPath “//html” (Behat\Mink\Exception\DriverException)

symfony2,xpath,behat,mink,symfony-2.7
I really can't figure out why Mink / Behat cannot find "Login" text. My scenario is simple enough: Scenario: Valid Registration Given I am on "/register/" Then the response status code should be 200 Then print current URL Then show last response Then I should see "Login" And the output...

Enabling Mink Extension in Behat

bdd,behat,mink
I'm trying to add the Mink extension to Behat. I've installed Behat, Mink and Mink-Extension through composer. However, now I'm having trouble with enabling the extension. Here is my behat.yml: default: extensions: Behat\MinkExtension\Extension: base_url: http://en.wikipedia.org goutte: ~ selenium2: ~ Here is my example test: Feature: New In order to test...

Behat/Mink and Select2 combo

php,jquery-select2,behat,mink
I try to create a Behat scenario with web UI using Select2. When I try to change the select value, I've an Behat error because of the base select which is hide by Select2. But I already have an error with the select2 component because mink can not interact with...

Behat / Mink error Snippets for the following steps not generated

php,bdd,behat,mink
When switching over from Behat to Mink in v3 to use headless browser for testing. It stops generating Snippets for me automatically from my feature files. Following the setup for features/bootstrap/FeatureContext.php from the docs. behat # generates this error at the bottom of the output --- Snippets for the following...

I can't connect to my site

selenium,behat,mink
I've just started playing around with behat, and I was loving it. Then I shut down my computer and went home for the day and when I came back, nothing worked for me anymore!! I've been trying to trouble shoot this for a couple of days, but looks like the...

Behat 3 - Behat\Behat\Context\Step\Given not found

php,bdd,behat,mink
I'm testing Behat/Mink for the first time with a simple example. When I launch behat I have this error : PHP Fatal error: Class 'Behat\Behat\Context\Step\Given' not found in /var/www/behat-test/features/bootstrap/FeatureContext.php on line 31 features/bootstrap/FeatureContext.php : <?php require_once './vendor/autoload.php'; use Behat\Behat\Context\Context; use Behat\Behat\Context\SnippetAcceptingContext; use Behat\MinkExtension\Context\MinkContext; use Behat\Behat\Context\Step; class FeatureContext extends MinkContext implements...