Print

Print


One problem with webdriver (selenium 2) testing is that Firefox can
pop up repeatedly when auto testing which can be really annoying. One
work around is to use a virtual display. Rather than headless testing
you can do something similar on a Linux system by using an X virtual
framebuffer (Xvfb) [1]. You create a virtual display, export the
DISPLAY environmental variable, and then run your tests that require
javascript or a browser from that shell environment. Your tests will
actually run in Firefox, but you don't have to see the window.

By the way, if you are using Ruby I think capybara (a replacement for
webrat) is worth a look for easy integration for javascript testing.
For instance I just have to tag a Cucumber feature as @selenium for
just those tests to run in a browser. All other tests can run in the
faster browserless mode.

But with all the buzz here about Jasmine, I'll have to check that out as well.

Jason

[1] http://en.wikipedia.org/wiki/Xvfb

On Thu, Jan 27, 2011 at 9:37 AM, John Loy <[log in to unmask]> wrote:
> Bess,
>
> Good to hear from you! I've been using Jasmine with its jQuery
> extension<https://github.com/velesin/jasmine-jquery>for HTML fixtures
> and DOM-related expect methods in
> tandem with Google's
> JsTestDriver<https://github.com/ibolmo/jasmine-jstd-adapter> .
> For data fixtures, take a look as Jupiter's jQuery fixtures
> plugin<http://jupiterjs.com/news/ajax-fixtures-plugin-for-jquery>.
> Though you can run Jasmine in a continuous integration environment with its
> Gem, which in turn uses Selenium RC and Firefox, JsTestDriver allows
> simultaneous running of tests in multiple browsers. Headless testing doesn't
> make a whole lot of sense to me. I'd rather know for certain that my code is
> cross-browser.
>
> Hope you are well.
>
> Cheers,
> John
>
> On Tue, Jan 11, 2011 at 7:21 PM, Bess Sadler <[log in to unmask]> wrote:
>
>> Can anyone recommend a javascript testing framework? At Stanford, we know
>> we need to test the js portions of our applications, but we haven't settled
>> on a tool for that yet. I've heard good things about celerity (
>> http://celerity.rubyforge.org/) but I believe it only works with jruby,
>> which has been a barrier to getting started with it so far. Anyone have
>> other tools to suggest? Is anyone doing javascript testing in a way they
>> like? Feel like sharing?
>>
>> Thanks!
>>
>> Bess
>>
>