Top Banner
Getting Started with Behat and Automated Testing Rex Lorenzo ( [email protected] ) Alfonso Roman ( [email protected] )
16

Getting Started with Behat and Automated Testing

May 08, 2015

Download

Technology

Rex Lorenzo

Workshop given at the 2014 Mountain Moodle Moot.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Getting Started with Behat and Automated Testing

Getting Started with Behat and Automated Testing

Rex Lorenzo ([email protected]) Alfonso Roman ([email protected])

Page 2: Getting Started with Behat and Automated Testing

Outline• Intro

• 10,000 foot overview of Behat

• Getting started (writing our first test)

• Deeper dive

• Break

• Group work!

• Conclusion

Page 3: Getting Started with Behat and Automated Testing

Intro

Who are we?

Who are you?

• How do you test your code?

• Goals for workshop?

Page 4: Getting Started with Behat and Automated Testing

10,000ft View

• What is BDD

• How?

• Why?

Page 5: Getting Started with Behat and Automated Testing

The Dream

Page 6: Getting Started with Behat and Automated Testing

What is Behat?

PHP

BDD

Gerkins

Selenium

Page 7: Getting Started with Behat and Automated Testing

What is Behat?

Converts English to Automated browser tests

Page 8: Getting Started with Behat and Automated Testing

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”

Page 9: Getting Started with Behat and Automated Testing

Why would you use it?

Automated

Proof

Regressions

Page 10: Getting Started with Behat and Automated Testing
Page 11: Getting Started with Behat and Automated Testing

Getting started

How to setup Behat in Moodle

Running your first script

Running specific scripts

How to write a basic feature and scenario

Page 12: Getting Started with Behat and Automated Testing

Deeper dive

How to look for existing Behat steps

Using backgrounds

Using Moodle data generators

Page 13: Getting Started with Behat and Automated Testing

–Theodore Roosevelt

“Believe you can and you're halfway there.”

Page 14: Getting Started with Behat and Automated Testing

Group work!

Choose your own adventure

Page 15: Getting Started with Behat and Automated Testing

Conclusion

Page 16: Getting Started with Behat and Automated Testing

Related links

Moodle’s Acceptance testing docs http://docs.moodle.org/dev/Acceptance_testing

KNP Labs BDD/Behat training http://knplabs.com/training/behat Workshop slideshttp://www.slideshare.net/rexlorenzo/behat-workshop