Behat & Automated Testing (Lightning Talk)

464 views

Published on

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

Published in: Software, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
464
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

×