Culerity - Headless full stack testing for JavaScript

3,282 views

Published on

This is a presentation i gave at the Java Script User group (twitter.com/berlinjs). It is about testing your entire web application including javascript without opening a browser for that.

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

No Downloads
Views
Total views
3,282
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
22
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Culerity - Headless full stack testing for JavaScript

  1. 1. Culerity Headless Fullstack Testing for Web Applications see github.com/langalex/culerity
  2. 2. Look How ’s talking!
  3. 3. Thilo with a H! github.com/thilo
  4. 4. 1st Thursday every Month, rug-b.de
  5. 5. coworking-space, co-up.de
  6. 6. UPSTREAM my company, upstre.am
  7. 7. we done lot of web apps our own latest product: co-bot.me
  8. 8. Done all apps test driven
  9. 9. Problem we have unit tests for all our code. And some integration tests. But....
  10. 10. Does it work as a whole? All the bits and pieces fit together? I could test manually It is Cumbersome Better Automate it too, we are developers
  11. 11. 2 Flavors
  12. 12. In Browser run your test in an actual browser by scripting it
  13. 13. Headless some software only "Browser"
  14. 14. Properties of Headless Testing
  15. 15. Consistent Behavior
  16. 16. Direct API for Interaction
  17. 17. Enter Culerity First solution to test web apps full-stack including Javascript with ruby
  18. 18. The Components (Cucumber) Culerity Celerity HtmlUnit Rhino culerity is just a part, but an important one
  19. 19. written in ruby
  20. 20. PlainText Acceptance Test Uses a human readable DSL to specify test cases
  21. 21. Matched agains Test Steps each line is matched against a step which implements logic steps include, setup (Given), interaction (When), assertions (Then)
  22. 22. Culerity
  23. 23. mostly ruby small part runs in Jruby
  24. 24. Proxy Library
  25. 25. Interaction - Low Level can be used without webrat.
  26. 26. Can get complicated! finding a link either by text, id, title or partial matching text
  27. 27. Cucumber Steps that uses the Proxy provides easy cucumber steps that wraps interaction
  28. 28. Celerity
  29. 29. in Jruby
  30. 30. Api Wrapper for HTML Unit
  31. 31. HtmlUnit
  32. 32. pure Jave
  33. 33. GUI-Less browser so no fancy gui to show here
  34. 34. simulates browser behavior of Firefox2, Firefox3 or IE
  35. 35. Rhino JavaScript implementation in Java part of html that does the javascript
  36. 36. How it fits together Culerity BrowserProxy ObjectProxy CelerityServer CelerityBrowser HTMLUnit Above line ruby, below Jruby 1. Culerity starts Celerity Server as a Subprocess in Jruby - Serialize back end forth Calls through STDIN and STDOUT 2. Browser Proxy object controls a Celerity Browser instance 3. ObjectProxies are created for non literal Results when interacting with the celerity browser
  37. 37. Action see code at github.com/thilo/culerity_talk_src
  38. 38. Shortcomings • Dynamic Changes only on element level (wrapping div) • Blocks have no access to context • HTMLUnit Bugs • Extra Process
  39. 39. The Future is Now! Some other solutions with improvements - Only one Test Process with Ruby Java Bridge - Steam - Mutli Backends - With Capybara - Javascript Only Dom Enviroment on Rhino - Env-Js (since 2007)
  40. 40. Thanks!
  41. 41. Questions ?
  42. 42. Credits • http://www.flickr.com/photos/montyhood/4414773547/ • jruby.org • ruby.org • http://www.mozilla.org/rhino/ • http://hubblesite.org/gallery/album/entire/pr2001025a/ • FF, IE, Java Logo from wikipedia • Rug-B Logo Copyright by Nico Hagenburger • Cucumber Logo from cukes.info by Gideon Bullock

×