getting started with behat and automated testing

Post on 08-May-2015

419 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Workshop given at the 2014 Mountain Moodle Moot.

TRANSCRIPT

Getting Started with Behat and Automated Testing

Rex Lorenzo (rex@oid.ucla.edu) Alfonso Roman (aroman@oid.ucla.edu)

Outline• Intro

• 10,000 foot overview of Behat

• Getting started (writing our first test)

• Deeper dive

• Break

• Group work!

• Conclusion

Intro

Who are we?

Who are you?

• How do you test your code?

• Goals for workshop?

10,000ft View

• What is BDD

• How?

• Why?

The Dream

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 should see “Welcome to My Course”

Why would you use it?

Automated

Proof

Regressions

Getting started

How to setup Behat in Moodle

Running your first script

Running specific scripts

How to write a basic feature and scenario

Deeper dive

How to look for existing Behat steps

Using backgrounds

Using Moodle data generators

–Theodore Roosevelt

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

Group work!

Choose your own adventure

Conclusion

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

top related