Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Lightning Talk
Behat & Automated
Testing
Rex Lorenzo

rex@oid.ucla.edu
The dream
“Let the computer do the
repetitive, mind numbing
work”
Outline
1. What?!
2. How?!
3. Why?
What is Behat?
PHP!
BDD!
Gerkins!
Selenium
What is Behat?
Converts English to Automated browser tests
How do you use it?
Scenario: Seeing a welcome message!
Given I log in as “teacher”!
When I follow “My Course”!
Then I shou...
Hundreds of “steps”
Given I turn editing mode on!
Given I create a course with:!
| fullname | shortname | format |!
| Math...
Demo
How does it work?


Example: When I follow “My Course”!
/**

* @When /^I follow "(?P<link_string>(?:[^"]|")*)"$/!
*/!
publ...
Why would you use it?
Automated!
Proof!
Regressions
Why else?
Cross-browser/OS testing!!
!
!
!
!
!
Why else?
Anyone can write tests!
! With some caveats
Related links
❖ Moodle’s Acceptance testing docs

http://docs.moodle.org/dev/Acceptance_testing!
❖ KNP Labs BDD/Behat trai...
Behat & Automated Testing (Lightning Talk)
Upcoming SlideShare
Loading in …5
×

Behat & Automated Testing (Lightning Talk)

My lightning talk presentation about Behat & Automated testing at the Mountain Moot 2014.

  • Be the first to comment

  • Be the first to like this

Behat & Automated Testing (Lightning Talk)

  1. 1. Lightning Talk Behat & Automated Testing Rex Lorenzo
 rex@oid.ucla.edu
  2. 2. The dream “Let the computer do the repetitive, mind numbing work”
  3. 3. Outline 1. What?! 2. How?! 3. Why?
  4. 4. What is Behat? PHP! BDD! Gerkins! Selenium
  5. 5. What is Behat? Converts English to Automated browser tests
  6. 6. How do you use it? Scenario: Seeing a welcome message! Given I log in as “teacher”! When I follow “My Course”! Then I should see “Welcome to My Course”
  7. 7. Hundreds of “steps” Given I turn editing mode on! Given I create a course with:! | fullname | shortname | format |! | Math 101 | math101 | topic |! Given I import “source” course into “destination” course
  8. 8. Demo
  9. 9. How does it work? 
 Example: When I follow “My Course”! /**
 * @When /^I follow "(?P<link_string>(?:[^"]|")*)"$/! */! public function click_link($link) {! $linknode = $this->find_link($link);! $linknode->click();! }! Regular expressions
  10. 10. Why would you use it? Automated! Proof! Regressions
  11. 11. Why else? Cross-browser/OS testing!! ! ! ! ! !
  12. 12. Why else? Anyone can write tests! ! With some caveats
  13. 13. Related links ❖ Moodle’s Acceptance testing docs
 http://docs.moodle.org/dev/Acceptance_testing! ❖ KNP Labs BDD/Behat training
 http://knplabs.com/training/behat

×