Your SlideShare is downloading. ×
0
JS Testing VIA Selenium   The good, the bad, the obvious. @admc
Do you have a beer?If you look at your hand, and it doesn’t have a beer...Thanks Yammer for hosting!This is going to be ni...
Why? Again...Web Applications - getting bigger  More complex  More browsers and devicesClient side apps are built in JS  N...
It’s better now than it was Selenium 1   selenium.getEval("this.browserbot.getCurrentWindow().docum   ent.getElementById(‘...
The Testable Bits You should have backend unit tests You should have web services tests You should have JavaScript Unit te...
Testing Pyramid FTW.       Start at the bottom.
JavaScript Testing Verifying DOM - verify attributes Firing Events - verify callback results Network Calls - verify mock c...
Using ExecuteJavaScript State  selenium.execute(“window.myApp.mystate == true”)Network  selenium.execute_async + foo unit ...
Client Side Unit Tests Launch browser/environment Load up FooUnit, QUnit, Jasmine, or your “home brew” Selenium.execute to...
My Selenium 2 VisionLaunch Browsers - FASTNavigate to pagesExecute JavaScriptAssert resultsDrink a beer.
SE 2 is Important The vision of a shared browser automation API Continuing to be more performant A community and dedicatio...
Tool ChainsThe power of SE 2Client side JavaScript Unit Test FrameworksRaw JavaScript access to the DOMCI SystemsAll thing...
Q&Ahttp://admc.iohttps://github.com/admc/@admc
Upcoming SlideShare
Loading in...5
×

JavaScript Testing VIA Selenium

35,563

Published on

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
35,563
On Slideshare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
86
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "JavaScript Testing VIA Selenium"

    1. 1. JS Testing VIA Selenium The good, the bad, the obvious. @admc
    2. 2. Do you have a beer?If you look at your hand, and it doesn’t have a beer...Thanks Yammer for hosting!This is going to be ninja fast and to the point.
    3. 3. Why? Again...Web Applications - getting bigger More complex More browsers and devicesClient side apps are built in JS Nothing new, still hard to test.
    4. 4. It’s better now than it was Selenium 1 selenium.getEval("this.browserbot.getCurrentWindow().docum ent.getElementById(‘mything’).click()"); - WTF Selenium 2 / WebDriver x.execute("window.location.href", function(o) { console.log(o) }) - WINNER
    5. 5. The Testable Bits You should have backend unit tests You should have web services tests You should have JavaScript Unit tests You should have JavaScript Functional tests You should have client side SE Tests
    6. 6. Testing Pyramid FTW. Start at the bottom.
    7. 7. JavaScript Testing Verifying DOM - verify attributes Firing Events - verify callback results Network Calls - verify mock callback results JavaScript Code - verify state
    8. 8. Using ExecuteJavaScript State selenium.execute(“window.myApp.mystate == true”)Network selenium.execute_async + foo unit or Mock.js, JSMock, etcEvents selenium.execute_async - Google it :) Some extra setup hereDOM assert selenium.execute(“$(‘#mydiv’).width == ‘50px’”)
    9. 9. Client Side Unit Tests Launch browser/environment Load up FooUnit, QUnit, Jasmine, or your “home brew” Selenium.execute to retrieve results Don’t worry, we are going to beat this horse to death!
    10. 10. My Selenium 2 VisionLaunch Browsers - FASTNavigate to pagesExecute JavaScriptAssert resultsDrink a beer.
    11. 11. SE 2 is Important The vision of a shared browser automation API Continuing to be more performant A community and dedication from Google Ongoing browser and version support - new releases
    12. 12. Tool ChainsThe power of SE 2Client side JavaScript Unit Test FrameworksRaw JavaScript access to the DOMCI SystemsAll things combined, we are captain tester!
    13. 13. Q&Ahttp://admc.iohttps://github.com/admc/@admc
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×