24
Headless Browser Testing with Ruby by Justin Halsall (@juice10) CTO of Betribes.com

Headless browser testing with ruby

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Headless browser testing with ruby

Headless Browser Testing with Rubyby Justin Halsall (@juice10)

CTO of Betribes.com

Page 2: Headless browser testing with ruby

Our process

Page 3: Headless browser testing with ruby

Make user storieswrite out all the different actions users can and can’t do

Page 4: Headless browser testing with ruby

Write out Acceptance testsUsing Rspec/Steak

Page 5: Headless browser testing with ruby

Run the tests!Doesn’t do much but its working!

Page 6: Headless browser testing with ruby

Write out the first scenarioDo this before you actually create the feature

Page 7: Headless browser testing with ruby

Run the tests!And it fails! But we where expecting that...

Page 8: Headless browser testing with ruby

Go ahead! Create that feature!Yeah boi, its hammer time!

Page 9: Headless browser testing with ruby

Run it again and... no failures!Yippy!

Page 10: Headless browser testing with ruby

That wasn’t too hardLets step it up

Page 11: Headless browser testing with ruby

Write out the second scenario

Page 12: Headless browser testing with ruby

Visit the page

Page 13: Headless browser testing with ruby

Specify area with CSS expression

Page 14: Headless browser testing with ruby

Click on the link

Page 15: Headless browser testing with ruby

Make sure you end up where you expect

Page 16: Headless browser testing with ruby

Run tests: Red, green, refactorhttp://www.flickr.com/photos/tasuki/3503304405

Page 17: Headless browser testing with ruby

Of course you can do moreeg. interacting with forms

Page 18: Headless browser testing with ruby

Of course you can do moreeg. interacting with forms

Page 19: Headless browser testing with ruby

Wow that was awesome!Yeah I know right!

Page 20: Headless browser testing with ruby

Whats the difference?

Page 21: Headless browser testing with ruby

Its way faster!http://www.flickr.com/photos/scallop_holden/2203771977

Page 22: Headless browser testing with ruby

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

Page 23: Headless browser testing with ruby

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

Page 24: Headless browser testing with ruby

Kthnx questions?

Me: Justin Halsall

Twitter: @juice10

E-mail: [email protected]

Guess who’s looking for colleagues?

We are! .com