behat 3.0 meetup (march)
DESCRIPTION
Slides from the presentation of behat v3 in LondonTRANSCRIPT
behat
current state
468 631 installssince v2.2 (2011-12-14)
SyliusOpenSource E-commerce framework
akeneoOpenSource PIM framework
OpenScholarOpenSource site builder for academic institutions
Drupal.orgBig migration driven by Melissa Anderson
INVIQAEnterprise OpenSource agency
The BDD in PHP is big!
Behat
1. parallel execution
2. growing contexts
– Me
“Context class is your domain dictionary for a specific actor”
– Me
“There’s only one context class for all your features.”
3. actor-based definitions
3 problems, 1 solution
you should be able to test features against different
contexts
v2.x architecture
profile
profile
.feature #1
profile
.feature #1
.feature #2
.feature #3
profile
.feature #1
.feature #2
.feature #3
Your Context class (+ Sub-Context classes)
Context class !
definitions transformations
hooks
Context class !
definitions transformations
hooksBehat
Context class !
definitions transformations
hooksBehat
profile
profile
suite #1
profile
suite #1
suite #2
Suite is a collection of features and their
test configuration
profile
suite #1
suite #2
.feature #1
.feature #2
Your Context class
profile
suite #1
suite #2
.feature #1
.feature #2
Your Context class
.feature #3
.feature #4
Your other Context class
profile
suite #1
suite #2
.feature #1
.feature #2
Your Context class
.feature #1
.feature #2
Your other Context class
suite configthrough behat.yml
suite configthrough behat.yml
stop! demo time.
contexts
profile
suite #1
suite #2
.feature #1
.feature #2
Your Context class
.feature #1
.feature #2
Your other Context class
profile
suite #1
suite #2
.feature #1
.feature #2
Your Context classes
.feature #1
.feature #2
Your other Context classes
contexts configthrough behat.yml
contexts configthrough behat.yml
demo
definitions matching
@When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
regexp’s are hard
TurnipGherkin extension for RSpec
Turnip matchingthrough placeholders
@Given there is a monster called :name
@Given there is a monster called :nameGiven there is a monster called “Jake”
@Given there is a monster called :nameGiven there is a monster called “Jake” Given there is a monster called ‘Jake’
@Given there is a monster called :nameGiven there is a monster called “Jake” Given there is a monster called ‘Jake’ Given there is a monster called Jake
@Given there is a monster called :nameGiven there is a monster called “Jake” Given there is a monster called ‘Jake’ Given there is a monster called Jake
Given there is a monster called 23
@Given there is/are :count monster(s)
@Given there is/are :count monster(s)Given there is 1 monster
@Given there is/are :count monster(s)Given there is 1 monster
Given there are 5 monsters
@Given there is/are :count monster(s)Given there is 1 monster
Given there are 5 monsters Given there are no monsters
Turnip is a new default
both turnip and regex are supported
both turnip and regex are supported
inside same context class
SnippetsAcceptingContext
demo
Hooks are the 1st class citizens
hooks blowupin v2.x
demo
Formatters
rewritten from scratch
outline shows step that failed
outline steps expand
and 1000 other small improvements
output buffering
$this->printDebug(‘…’)
demo
Error handling levels
-v
exception handlingwith Mink or other integrations
exception handlingwith standard exceptions
-v is not --vv
how
continuous integrationthrough TravisCI
continuous integrationthrough Scrutinizer
v3in one picture
Testwork
last demo
next steps
3.0.0 rc3 releasedand it is gold version
behat.orgv2.0 is coming
extensionsupgrade
and release…
20 april
20 april 2014
big thanks to
Aslak Hellesøy
Creator of Cucumber
Christophe Coevoet
@stof
Questions?