Date post: | 25-Jun-2015 |
Category: |
Technology |
Upload: | brian-moschel |
View: | 3,718 times |
Download: | 0 times |
FuncUnitCrash Course in JavaScript
Functional Testingby Brian Moschel
October 2010
We’re Gonna Test Srchr
The Testing Landscape
*
What the FuncUnit?
+ + + =
Want to Functional Test Your JS App?
…with FuncUnit?
Testing === Pain
1. Barriers to Entry
2. Completely Foreign APIs
3. Debugging Across Platforms4. Low Fidelity Event Simulation5. QA and Developers Can’t Communicate
arr
Getting Started Is Annoying
arr
Download & Start Testing
arr
You Know I Don’t Speak Spanish!
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").Clickg.Link("name:=Inbox.*","html id:=WelcomeInboxFolderLink").Clickg.Link("name:=Sign Out").Click
arr
But I Do Speak jQuery
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") })});
arr
Cross Platform Debugging?
arr
Firebug, Please
arr
Your Tests Don’t Do What You Think
arr$(“input”).bind(“focus”, function(ev){ if ( $(this).val() == "Search API" ) { $(this).val("").removeClass('notFocused') }})
arr
Accurate Event Simulation: Trust Your Tests
syn.js
arr
QA vs. Developers
arr
QA is Your Friend
arr
A Tested App in 15 Minutes
1. Install2. Learn the API3. Write a test4. Debug tests5. Run tests6. Hand off to QAhttp://github.com/jupiterjs/srchr
arr
Want more?
http://funcunit.comhttp://jupiterjs.comhttp://javascriptmvc.com
[email protected]@jupiterjs@brianmoschel@funcunit