headless browser testing with ruby
Post on 07-Nov-2014
4.192 Views
Preview:
DESCRIPTION
TRANSCRIPT
Headless Browser Testing with Rubyby Justin Halsall (@juice10)
CTO of Betribes.com
Our process
Make user storieswrite out all the different actions users can and can’t do
Write out Acceptance testsUsing Rspec/Steak
Run the tests!Doesn’t do much but its working!
Write out the first scenarioDo this before you actually create the feature
Run the tests!And it fails! But we where expecting that...
Go ahead! Create that feature!Yeah boi, its hammer time!
Run it again and... no failures!Yippy!
That wasn’t too hardLets step it up
Write out the second scenario
Visit the page
Specify area with CSS expression
Click on the link
Make sure you end up where you expect
Run tests: Red, green, refactorhttp://www.flickr.com/photos/tasuki/3503304405
Of course you can do moreeg. interacting with forms
Of course you can do moreeg. interacting with forms
Wow that was awesome!Yeah I know right!
Whats the difference?
Its way faster!http://www.flickr.com/photos/scallop_holden/2203771977
Speed speed speeeed! (our test suite takes 30 minutes to complete on a fast machine using a headless web browser)
Easier to set up the environment and test edge cases.
Abstracted so easy to change out for different browser in the future.
Headless Browser vs Selenium
ToolsRuby http://ruby-lang.org
Rspec http://rspec.info/
Capybara https://github.com/jnicklas/capybara
HtmlUnit http://htmlunit.sourceforge.net/
Akaphelos http://oinopa.com/akephalos/
Steak https://github.com/cavalle/steak
Ruby on Rails http://rubyonrails.com
Machinist https://github.com/notahat/machinist
optional
optional
optional
optional
Kthnx questions?
Me: Justin Halsall
Twitter: @juice10
E-mail: justin@betribes.com
Guess who’s looking for colleagues?
We are! .com
top related