Searching test on homepage works ok. But I'm not sure how submit should work and how to debug it. That's what I have:
behat.yml
default:
formatter:
name: progress
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
base_url: http://my.dev/
goutte: ~
Search.feature
Feature: Search
Search
Background:
Given I am on "/"
Scenario: Empty Search
When I fill in "query" with "love"
And I press "Search"
Then I should see "Love Results"
bash
$ ./bin/behat --verbose --profile=default "@MySiteBundle/Search.feature"
...F.P-..P-..P--.F---.F---
(::) failed steps (::)
01. The text "Love Results" was not found anywhere in the text of the current page.
+--[ HTTP/1.1 200 | http://my.dev/ | GoutteDriver ]
So address is still "/" which means that form was not submitted.
Is Goutte a wrong driver for this purpose? Or is it my strange config (because "/" is not served by symfony2, other part of site is)?
UPDATE:
Debug from inside of BroserKit/Client shows that URI where form is supposed to be submitted to is wrong, returns 404. And behat in verbose mode does not show that.
If your form submit is handled by Javascript, you should use Selenuim2 instead of goutte, and add the @javascript annotation on top of your feature file.