• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Natural Language UI Testing using Behavior Driven Development with Pavlov and QUnit
 

Natural Language UI Testing using Behavior Driven Development with Pavlov and QUnit

on

  • 3,706 views

Slides from my talk at jQuery Conference: San Francisco Bay Area 2011 (http://spkr8.com/t/7239)

Slides from my talk at jQuery Conference: San Francisco Bay Area 2011 (http://spkr8.com/t/7239)

Statistics

Views

Total Views
3,706
Views on SlideShare
3,511
Embed Views
195

Actions

Likes
4
Downloads
0
Comments
0

4 Embeds 195

http://lanyrd.com 156
http://speakerrate.com 37
http://www.linkedin.com 1
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • Who writes tests for their JavaScript?\n\nAny Ruby programmers? Ever use RSpec?\n
  • I don’t know what that means...\n\nBDD is a test-driven-development methodology. \n\nWrite tests.\nWrite code to pass the tests.\nThat’s it.\n\nRed, Green, Refactor.\n\nMake sure it fails first, if it doesn’t how will you know if it’s a good test? (Red Step)\n\nWrite only enough code to make it pass. (Green Step)\n\nLater, if you need more functionality, refactor, and make sure all of your old tests still pass.\n
  • Anybody heard of it?\n
  • Inspired by Screw.Unit and RSpec but with QUnit compatibility (so you can use it with QUnit’s existing support for JsTestDriver and TestSwarm)\n\nMIT License\n\n
  • Build a small login form for a web application, the kind with labels in the text boxes that disappear on focus\n\nIt should work without JavaScript enabled, but if we do have it we’ll take advantage of it\n\nMarkup and concept roughly based on Making Compact Forms More Accessible by Mike Brittain from A List Apart\n\nConvert this Spec into a test suite\n\n\n
  • \n
  • \n
  • isLessThan20ButGreaterThan10\n\nTestSwarm\nJsTestDriver\n\n\n
  • In-progress refactor to be testing-framework neutral, coming soon YUI2 and YUI3\navailable in the framework-agnostic branch on GitHub. \n\nWill retain backwards compatibility.\n\n\n\n\n\n\n\n
  • \n

Natural Language UI Testing using Behavior Driven Development with Pavlov and QUnit Natural Language UI Testing using Behavior Driven Development with Pavlov and QUnit Presentation Transcript

  • Natural Language UI Testing Using Behavior-Driven Development With Pavlov and QUnitEric DeLabarSolutions Architect at Trifecta Technologieshttp://www.trifecta.com/
  • What is BehaviorDriven Development? (BDD)
  • “BDD is a second-generation, outside-in, pull-based, multiple-stakeholder,multiple-scale, high-automation, agilemethodology. It describes a cycle ofinteractions with well-defined outputs,resulting in the delivery of working,tested software that matters.”
  • What is Pavlov?
  • Behavioral API over QUnit by Michael Monteleonehttp://github.com/mmonteleone/pavlov
  • The Goal:The login form should progressively enhance a form by id. should hide a field label when the field has focus. should show a field label when the field is empty when the cursor leaves. should keep a field label hidden when the field is not empty when the cursor leaves. should validate that the email field is valid when the cursor leaves. should submit the form when the user clicks the Join button. should submit to the action URL of the form with an AJAX POST. should hide the form if the user credentials are ok.
  • Let’s Write Some Code!
  • Demo
  • Other Features• Custom Assertions• Expected Exceptions• Doesn’t Pollute the Global Scope• Run from Command Line or CI Server
  • Future of Pavlov• Testing-framework-neutral refactor in-progress
  • Materials • Source on GitHub: • Slides on SlideShare:Questions/Comments • Twitter: @edelabar • Email: emd@trifecta.com • SpeakerRate: http://spkr8.com/s/11957