Your SlideShare is downloading. ×
FuncUnit
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

FuncUnit

3,477
views

Published on

A Crash Course in JavaScript Functional Testing

A Crash Course in JavaScript Functional Testing

Published in: Technology, Design

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,477
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
62
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • How many of you write jQuery applications? How many of you test them? How many of you enjoy testing them? You're in the right place.Honestly this project is so far ahead of the competition when it comes to functional testing, if you’re not convinced when I’m done, I’ve done a terrible job.
  • Here is a high level overview of what’s out there right now. A bunch of tools written for server side developers who make web pages. Qunit doesn’t really count because its not functional testing.Logic in web applications are moving more into the rich client. These tools are designed for the time when most logic happened on the server after a click or form submission. FuncUnit is designed for the world of rich client web apps.FuncUnit is to Functional testing what jQuery was to JavaScript development. It provides an approachable way to write maintainable cross browser tests.
  • Funcunit is built on the shoulders of giants. Under the hood, it uses Selenium, Qunit, jQuery, Syn.js (a synthetic event simulation library), env.js, and Rhino.
  • We love Selenium. But it wasn’t built for JS developers or by JS developers.
  • FuncUnit will make testing fun, easy, and approachable. It was built by jQuery developers for jQuery developers, and in that sense is the first functional testing tool of its kind.
  • Everyone simply hates testing. Why is that?
  • Setup, Installation, Cost, Difficult APIsQTP costs 5K per license
  • No setup, open source, free, no installation
  • APIs are another language to learn
  • APIs are another language to learn
  • LeveragesjQuery knowledge
  • LeveragesjQuery knowledge
  • Run tests only one way....scripted via serverDebugging across platforms, languagesNo firebug breakpoints
  • Run tests in browserSet firebug breakpoints
  • brittle/low fidelitydoesn’t corectly simulate browser JS eventsNot designed for crazy JS apps, designed for web apps with HTML and navigation
  • For example: selenium clicks simulate a click event, in browser this actually sends a focus event if you’re clicking an input. If your JS code depends on this focus, it will break. There are a LOT of cases like this. Syn was developed to accurately simulate everything possible
  • syn.js, a library that simulates high fidelity browser eventsGoes to extra trouble to make sure each browser works as intended (recorder app that checks how certain keypresses work)TheSizzle of event simulationPicked up by Mootools testing team also
  • Complex scenario to reproduce the issueCan’t send you a URL to easily repo locally
  • Send a URL to a test caseDevs write and maintain tests!
  • Tag line: Get yelled at less
  • Transcript

    • 1. FuncUnit
      Crash Course in JavaScript Functional Testing
      by Brian Moschel
      October 2010
    • 2. We’re Gonna Test Srchr
    • 3. The Testing Landscape
      *
    • 4. What the FuncUnit?
      +
      +
      +
      =
    • 5. Want to Functional Test Your JS App?
    • 6. …with FuncUnit?
    • 7. Testing === Pain
      1. Barriers to Entry
      2. Completely Foreign APIs
      3. Debugging Across Platforms
      4. Low Fidelity Event Simulation
      5. QA and Developers Can’t Communicate
    • 8. Getting Started Is Annoying
      arr
    • 9. Download & Start Testing
      arr
    • 10. You Know I Don’t Speak Spanish!
      arr
    • 11. arr
      SystemUtil.Run"iexplore","http://www.yahoomail.com"
      Set g=Browser("name:=Yahoo.*").Page("title:=Yahoo.*")
      g.WebEdit("name:=login").Set "aaa"
      g.WebEdit("name:=passwd").SetSecure "bbb"
      g.WebButton("name:=Sign In").Click
      g.Link("name:=Inbox.*",
      "html id:=WelcomeInboxFolderLink").Click
      g.Link("name:=Sign Out").Click
    • 12. But I Do Speak jQuery
      arr
    • 13. arr
      test("JavaScript results",function(){
      S('input').click().type("JavaScript")
      // wait until we have some results
      S('.autocomplete_item').visible(function(){
      equals( S('.autocomplete_item').size(), 5, "there are 5 results")
      })
      });
    • 14. Cross Platform Debugging?
      arr
    • 15. Firebug, Please
      arr
    • 16. Your Tests Don’t Do What You Think
      arr
    • 17. arr
      $(“input”).bind(“focus”, function(ev){
      if ( $(this).val() == "Search API" ) {
      $(this).val("").removeClass('notFocused')
      }
      })
    • 18. Accurate Event Simulation: Trust Your Tests
      arr
      syn.js
    • 19. QA vs. Developers
      arr
    • 20. QA is Your Friend
      arr
    • 21. A Tested App in 15 Minutes
      arr
      Install
      Learn the API
      Write a test
      Debug tests
      Run tests
      Hand off to QA
      http://github.com/jupiterjs/srchr
    • 22. Want more?
      arr
      http://funcunit.com
      http://jupiterjs.com
      http://javascriptmvc.com
      brian.moschel@gmail.com
      @jupiterjs
      @brianmoschel
      @funcunit