I'm current using Behat with Mink & Goutte Driver. When i'm trying to use it with my dev environment, via the app_dev.php
file, which is a typical app_dev.php
file from a Symfony2 Standard Edition, my tests are working just fine (Gists).
But, if I want to use a app_test
file (which is the same as the app_dev
file, except for the environment parameter set to "test" instead of "dev", and debug mode disabled), on the logout scenario, it seems that Goutte can't find the "user_signup" identifier, and in the "login" scenario, it does not find the "Root" text node. Indeed, when i'm using a print last response
, it seems that the user is just not logged in : I still see the forms to log in an user...
When i'm on my dev environment (app_dev
) or prod environment (app
), everything seems to be working just fine though... Any idea ?
(If you think you need some other files, please tell me).
behatverb. To place a hat (upon someone's head)
Behat is a PHP testing framework which can be used to automate acceptance tests in a human readable language called Gherkin. Since it is based on Cucumber, it also helps teams to adopt and implement Behavioral Driven Development (BDD).
Behat is a tool that makes behavior driven development (BDD) possible. With BDD, you write human-readable stories that describe the behavior of your application. These stories can then be auto-tested against your application.
What is BDD (Behavior-Driven Development)? Behavior-driven development is a testing practice that follows the idea of specification by example (e.g., Test-Driven Development [TDD]). The idea is to describe how the application should behave in a very simple user/business-focused language.
By default, Mink uses session called "symfony2". That's why you get different results accessing from browser and using Behat. You can change that in your behat.yml file. Check this doc for more info: http://extensions.behat.org/symfony2/index.html#symfony2-mink-session
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With