Francois Reynoud   Selenium Grid
Less Selenium, more unit testing          (With Jasmine)          Dima Kovalenko            @dimacus
What do you use for “in  browser” testing?
Selenium has some issues           
Selenium Issues• Reliability / Stability
Stability
Selenium Stability Last 2 months
Selenium Stability Last 12 months
Selenium Issues• Reliability / Stability• Speed
Build Time – 400 Selenium on 3   machines 6 parallel cores
Typical Selenium Flow
Typical Selenium Flow
Typical Selenium Flow
Typical Selenium Flow
Source: GIS
Why so slow?•   Browser speed•   JS speed•   Machine speed•   External URLs
Selenium Issues• Reliability / Stability• Speed• Internet Explorer / Browser Compatibility
Internet Explorer                    Source: GIS
Don’t use Selenium to test       JavaScript!  Use it to test application flow              instead.
http://pivotal.github.com/jasmine/
Jasmine• Reliability / Stability
Jasmine• Reliability / Stability• Browser Compatibility
Jasmine• Reliability / Stability• Browser Compatibility• Speed
Build Time (3,500+ tests)
Jasmine is a BDD tool(Behavior Driven Development)
What is BDDIn software engineering, behavior-driven development (abbreviated BDD) is asoftware development process based o...
BDD In the NutshellWrite tests that describe application                flow.
What BDD looks like“Purchase flow should accept VISA”
Jasmine Test Sample
It’s Just Functions!• “describe” “context” “it”…• Can use any JS code to make a test work
Jasmine Features•   Mocks / Spies•   Fixtures•   Matchers•   Setup / Teardown•   Asynchronous Support and Callbacks
Mocks / Spies•   Double any function•   Monitors the calls the function•   Monitors the arguments passed in•   Can create ...
Fixtures• Adding elements to page on the fly
Matchers•   expect()•   toEqual()•   not()•   toBeFalsy()•   toThrow()•   Custom matchers
Setup / Teardown• beforeEach()• afterEach()
Asynch support• Using spies to verify Callbacks• runs()• waitsFor()
What it is written in• HTML• JavaScript• Ruby  – Rake  – ERB  – Rspec
Workflow in Ruby•   Rake•   ERB (Generate HTML)•   Selenium•   Tests in Loaded JS•   Rspec
Environments supported•   Ruby•   Rails•   Spider Monkey•   Node•   Scala•   Java•   Django•   .Net•   Perl•   HTML
Installation• gem install jasmine• jasmine init
Questions?
Jasmine presentation Selenium Camp 2013
Jasmine presentation Selenium Camp 2013
Jasmine presentation Selenium Camp 2013
Jasmine presentation Selenium Camp 2013
Upcoming SlideShare
Loading in...5
×

Jasmine presentation Selenium Camp 2013

2,110

Published on

Presentation given by Dima Kovalenko at Jasmine Camp 2013

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,110
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Jasmine presentation Selenium Camp 2013

  1. 1. Francois Reynoud Selenium Grid
  2. 2. Less Selenium, more unit testing (With Jasmine) Dima Kovalenko @dimacus
  3. 3. What do you use for “in browser” testing?
  4. 4. Selenium has some issues 
  5. 5. Selenium Issues• Reliability / Stability
  6. 6. Stability
  7. 7. Selenium Stability Last 2 months
  8. 8. Selenium Stability Last 12 months
  9. 9. Selenium Issues• Reliability / Stability• Speed
  10. 10. Build Time – 400 Selenium on 3 machines 6 parallel cores
  11. 11. Typical Selenium Flow
  12. 12. Typical Selenium Flow
  13. 13. Typical Selenium Flow
  14. 14. Typical Selenium Flow
  15. 15. Source: GIS
  16. 16. Why so slow?• Browser speed• JS speed• Machine speed• External URLs
  17. 17. Selenium Issues• Reliability / Stability• Speed• Internet Explorer / Browser Compatibility
  18. 18. Internet Explorer Source: GIS
  19. 19. Don’t use Selenium to test JavaScript! Use it to test application flow instead.
  20. 20. http://pivotal.github.com/jasmine/
  21. 21. Jasmine• Reliability / Stability
  22. 22. Jasmine• Reliability / Stability• Browser Compatibility
  23. 23. Jasmine• Reliability / Stability• Browser Compatibility• Speed
  24. 24. Build Time (3,500+ tests)
  25. 25. Jasmine is a BDD tool(Behavior Driven Development)
  26. 26. What is BDDIn software engineering, behavior-driven development (abbreviated BDD) is asoftware development process based on test-driven development (TDD).[1][2]Behavior-driven development combines the general techniques and principlesof TDD with ideas from domain-driven design and object-oriented analysis anddesign to provide software developers and business analysts with shared tools and a shared process to collaborate on software development. Source: Wikipedia
  27. 27. BDD In the NutshellWrite tests that describe application flow.
  28. 28. What BDD looks like“Purchase flow should accept VISA”
  29. 29. Jasmine Test Sample
  30. 30. It’s Just Functions!• “describe” “context” “it”…• Can use any JS code to make a test work
  31. 31. Jasmine Features• Mocks / Spies• Fixtures• Matchers• Setup / Teardown• Asynchronous Support and Callbacks
  32. 32. Mocks / Spies• Double any function• Monitors the calls the function• Monitors the arguments passed in• Can create a “bare” spy• Mock the Clock
  33. 33. Fixtures• Adding elements to page on the fly
  34. 34. Matchers• expect()• toEqual()• not()• toBeFalsy()• toThrow()• Custom matchers
  35. 35. Setup / Teardown• beforeEach()• afterEach()
  36. 36. Asynch support• Using spies to verify Callbacks• runs()• waitsFor()
  37. 37. What it is written in• HTML• JavaScript• Ruby – Rake – ERB – Rspec
  38. 38. Workflow in Ruby• Rake• ERB (Generate HTML)• Selenium• Tests in Loaded JS• Rspec
  39. 39. Environments supported• Ruby• Rails• Spider Monkey• Node• Scala• Java• Django• .Net• Perl• HTML
  40. 40. Installation• gem install jasmine• jasmine init
  41. 41. Questions?
  1. A particular slide catching your eye?

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

×