Behaviour-driven development and regression testing with Behat

Learn how TP1 and the STM (Montreal's transit authority) are managing stakeholder expectations, regression tests and the team's understanding of specifications using Behat, Mink and Selenium.

With Behat, every user story can be defined as a series of human-readable steps in the client's native language, like this:

Scenario: As a transit user I want to know my next bus passages
  Given I am on the front page
  And I type in "80 North" in the "bus line" field
  And I select the first stop
  Then I see exactly 5 passages

The above is actually Behat code which can be signed off on by the client, and interpreted by a Selenium Server directly on a laptop to test that this actually works against a given environment with a real browser, captured as a movie.

And, contrary to Simpletest, Behat/Mink/Selenium support Javascript testing.

The result is a lot less misunderstanding, fewer regressions, and a better management of scope.

Schedule info
Status: 
Proposed
Session Info
Speaker(s): 
Track: 
Coding + Development
Experience level: 
Intermediate

Comments

Behat & Mink look to be fantastic tools. I would love to see real world examples such as described above at DrupalCon Portland.

@theMusician Hi, if this session is accepted, I plan to show the above example in action, and demonstrate how running such tests can prevent regressions. And you are right, Behat/Mink are fantastic tools, their strength is really demonstrating the value of testing to all stakeholders with a real wow-factor: tests are no longer just php code, they are actually human readable steps in the team's language (we actually use Behat in French at TP1).

I just now got the whole process working on IE9: I installed a virtual machine with Windows, Behat, Mink, Selenium and IE Driver on my laptop; and it works! IE is too often an afterthought, I would love to integrate it into my testing workflow.