The Front End Testing Frontier - RubyConf 2010

22
THE FRONT END TESTING FRONTIER CJ Kihlbom, Elabs – @cjkihlbom Jonas Nicklas, Elabs – @jncoward

description

While most Ruby developers are very familiar with testing their code, front end and JavaScript testing is still a new frontier for many. This talk will show you how to easily write and run JavaScript integration tests with Capybara and Cucumber, and unit tests with Evergreen and Jasmine. The goal is to inspire you to get started with frontend testing, and point you in the right direction to go do it!

Transcript of The Front End Testing Frontier - RubyConf 2010

Page 1: The Front End Testing Frontier - RubyConf 2010

THE

FRONT END TESTING FRONTIER

CJ Kihlbom, Elabs – @cjkihlbomJonas Nicklas, Elabs – @jncoward

Page 2: The Front End Testing Frontier - RubyConf 2010

WE LOVE TESTING

Page 3: The Front End Testing Frontier - RubyConf 2010

WE LOVE TESTING…RUBY CODE

Page 4: The Front End Testing Frontier - RubyConf 2010

FRONT END TESTING IS NEGLECTED

Page 5: The Front End Testing Frontier - RubyConf 2010

FRONT END TESTING ISHARD

Page 6: The Front End Testing Frontier - RubyConf 2010

INTEGRATION TESTING

Page 7: The Front End Testing Frontier - RubyConf 2010

CUCUMBER

Page 8: The Front End Testing Frontier - RubyConf 2010

STEAK

Page 9: The Front End Testing Frontier - RubyConf 2010

CAPYBARA

Page 10: The Front End Testing Frontier - RubyConf 2010

WEBRAT REPLACEMENT

Page 11: The Front End Testing Frontier - RubyConf 2010

DRIVER AGNOSTIC

Page 12: The Front End Testing Frontier - RubyConf 2010

DRIVER GOOD BAD

rack-test

Selenium

HTMLUnitCelerity/Culerity/Akephalos

Envjs

Fast, simple No JavaScript

Real browser, JavaScript & CSS Slow, requires GUI

Headless, good JavaScript support Pretty slow

Headless, faster than HTMLUnit

JavaScript and CSS not 100%

DRIVER AGNOSTIC

Page 13: The Front End Testing Frontier - RubyConf 2010

@javascript

Page 14: The Front End Testing Frontier - RubyConf 2010

UNIT TESTING

Page 15: The Front End Testing Frontier - RubyConf 2010

EVERGREEN

Page 16: The Front End Testing Frontier - RubyConf 2010

JASMINE

Page 17: The Front End Testing Frontier - RubyConf 2010

OUT OF THE BOX EXPERIENCE

Page 18: The Front End Testing Frontier - RubyConf 2010

TEMPLATES

Page 19: The Front End Testing Frontier - RubyConf 2010

STATIC TEMPLATE

EVERGREEN

TEMPLATE FRAGMENT

Page 20: The Front End Testing Frontier - RubyConf 2010

DEMO!

Page 21: The Front End Testing Frontier - RubyConf 2010

FRONT END TESTING IS NOT HARD

Page 22: The Front End Testing Frontier - RubyConf 2010

RESOURCES

CJ Kihlbom, Elabs – @cjkihlbomJonas Nicklas, Elabs – @jncoward

http://github.com/elabs/front_end_testinghttp://github.com/jnicklas/capybarahttp://github.com/jnicklas/evergreenhttp://github.com/pivotal/jasmine