This document discusses the benefits of automated testing and provides an introduction to Behat, an automated testing framework for PHP. It notes that automated tests can catch bugs before they hit production, improve team morale, and allow for faster code iterations. The document then demonstrates how to install and run Behat tests on a Drupal site using Gherkin syntax and scenarios. Resources for learning more about Behat, Mink, and test-driven development are also provided.
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Only Test the Features You Want to Keep
1. Do you need automated
testing?
Technology Stylings by @greggles
2. @greggles
● Drupalero for too many years
● Founded this group
● Father of a 4 year old and 1 year old
● I work at CARD.com
● curl -I https://www.card.com
● CARD.com/careers
12. Why you should write tests:
● Catch bugs before they hit the live site
● Can be a tool for customer acceptance
● Be confident your code covers all cases
● More confidence you can deploy code
○ Faster iterations
● Spend less on manual QA
● Team morale improves
● Wizards will give you their magic wands
18. What if….?
Bug report:
I went to CARD.com.
I look for the login link.
I should see it.
Behat test
Given I go to "https://www.card.com"
When I click "login"
Then I should see "Log in"
20. A behat “feature”
● Written in Gherkin syntax
● Starts with Benefit, Role, Feature:
○ In order to log in
○ As an anonymous user
○ I need to use the login link from the header
21. A Behat “feature”
● Written in Gherkin syntax
● Starts with Benefit, Role, Feature:
○ In order to log in
○ As an anonymous user
○ I need to use the login link from the header
● Contains Scenarios
● Which have Context, Events, Outcome