http://blip.tv/railsconf/kent-beck-three-rivers-institute-tri-saturday-keynote-1170018
"we are not testing that an application functions as we (developers) expect,
but instead
we're testing that it fulfils client business needs"
Konstantin Kudryashov (creator of Behat)
$ java -jar selenium-server-standalone-2.33.0.jar
$ mkdir tests
$ cd tests
{
"require": {
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4.*@stable",
"behat/mink-extension": "*",
"behat/mink-goutte-driver": "*",
"behat/mink-selenium2-driver": "*",
"drupal/drupal-extension": "*"
},
"minimum-stability": "dev",
"config": {
"bin-dir": "bin/"
}
}
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
$ ./bin/behat --init
which should respond with
+d features - place your *.feature files here
+d features/bootstrap - place bootstrap scripts and static files here
+f features/bootstrap/FeatureContext.php - place your feature related code here
default:
paths:
features: 'features'
extensions:
Behat\MinkExtension\Extension:
goutte: ~
selenium2: ~
base_url: http://drupal7.vm/
Drupal\DrupalExtension\Extension:
blackbox: ~
Note: base_url needs to match your environment!
use Drupal\DrupalExtension\Context\DrupalContext;
class FeatureContext extends DrupalContext
Feature: description
As a role
I want feature
So that benefit
Scenario: description
Given context
When event
Then outcome
Feature: Homepage
As a site visitor
I want see the welcome message
So that I know I am on the right site
Scenario: Visitor visits the homepage and observes the welcome message
Given I am on "/"
Then I should see "Welcome to localhost"
Feature: Homepage
As a site visitor
I want see the welcome message
So that I know I am on the right site
@javascript
Scenario: Visitor visits the homepage and observes the welcome message
Given I am on "/"
Then I should see "Welcome to localhost"
@javascript causes the test to launch and run in a browser