Collective Idea

Collective Idea Logo

Brian Ryckbost

The Search for Speedier Javascript Scenarios

By Brian Ryckbost on July 13, 2011 in

We kicked off a new project a few weeks back; Rails 3.1, heavier-on-the-JavaScript side kind of project. When we started, I had recently upgraded to FireFox 5 and it didn’t want to cooperate with the test suite. I went hunting for alternatives, settling on chromedriver and capybara-webkit.

After a couple days of development and testing between Chrome and capybara-webkit, I tweeted:

very simple Cucumber suite using Selenium; Chrome: 36 seconds, Firefox: 25 seconds. Using capybara-webkit: 7.5 seconds.

capybara-webkit is a headless (meaning it doesn’t have a graphical interface) WebKit driver using the WebKit implementation found in Qt. If you’re not familiar with Qt, it is a cross platform application and UI toolkit. Built by thoughtbot, I suggest you read their quest for full-stack testing here and here if you’re curious how they came to building capybara-webkit.

Installing capybara-webkit on OS X is straightforward. Do give it a try!

  1. Download the Qt non-debug Cocoa package [ Direct Link ]
  2. add gem "capybara-webkit" to your Gemfile
  3. Change the Capybara Javascript driver to webkit in env.rb, Capybara.javascript_driver = :webkit
By Brian Ryckbost on July 13, 2011 in

2 Comments

  1. Igor

    Igor July 23, 2011

    Hey, have you been able to use stubs with webkit as javascript driver? I know that it works in separate threads but it interesting how selenium is working with stubs. (I know that in stubs are not for acceptance testing but sometimes they are still needed for example to stub external service or stub generation of random thing like tokens, passwords etc..)

    Thanks!

  2. fake oakley

    fake oakley September 06, 2012 http://www.fakeoakleyol.com

    Many thanks for the excellent writeup. It the truth is had been a amusement accounts it. Glimpse leading-edge to considerably included acceptable from you! By the way, how could we communicate?

Post a Comment

Contact Us

Find us on Google Maps
Collective Idea
44 East 8th Street, Suite 410
Holland, Michigan 49423 USA 42.790334-86.105251

Follow us on the Interwebs

We are currently available for medium and long term projects. Please get in touch if we can be of service.