Re: [CODE4LIB] javascript testing?

2011-01-27 Thread John Loy
Bess,

Good to hear from you! I've been using Jasmine with its jQuery
extensionhttps://github.com/velesin/jasmine-jqueryfor HTML fixtures
and DOM-related expect methods in
tandem with Google's
JsTestDriverhttps://github.com/ibolmo/jasmine-jstd-adapter .
For data fixtures, take a look as Jupiter's jQuery fixtures
pluginhttp://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 bess.sad...@gmail.com 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



Re: [CODE4LIB] javascript testing?

2011-01-27 Thread Graham, Wayne (wsg4w)
Hi Bess, 

+1 for Jasmine. Used to dig blue-ridge for these things, but I don't think
they're maintaining that any more.

Wayne 

On 1/27/11 9:37 AM, John Loy loy.j...@gmail.com wrote:

 Bess,
 
 Good to hear from you! I've been using Jasmine with its jQuery
 extensionhttps://github.com/velesin/jasmine-jqueryfor HTML fixtures
 and DOM-related expect methods in
 tandem with Google's
 JsTestDriverhttps://github.com/ibolmo/jasmine-jstd-adapter .
 For data fixtures, take a look as Jupiter's jQuery fixtures
 pluginhttp://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 bess.sad...@gmail.com 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
 


Re: [CODE4LIB] javascript testing?

2011-01-27 Thread Jason Ronallo
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 loy.j...@gmail.com wrote:
 Bess,

 Good to hear from you! I've been using Jasmine with its jQuery
 extensionhttps://github.com/velesin/jasmine-jqueryfor HTML fixtures
 and DOM-related expect methods in
 tandem with Google's
 JsTestDriverhttps://github.com/ibolmo/jasmine-jstd-adapter .
 For data fixtures, take a look as Jupiter's jQuery fixtures
 pluginhttp://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 bess.sad...@gmail.com 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




Re: [CODE4LIB] javascript testing?

2011-01-26 Thread Gabriel Farrell
Hey Bess, dunno if you're still looking, but a friend just mentioned
this project running Jasmine tests headless with EnvJS:
https://github.com/trevmex/EnvJasmine. I haven't tried it out or
anything, but looks somewhat interesting.

On Tue, Jan 11, 2011 at 7:21 PM, Bess Sadler bess.sad...@gmail.com 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



Re: [CODE4LIB] javascript testing?

2011-01-12 Thread Jonathan Rochkind
As far as I can tell, while there are several, there are none that are 
actually Just Work good.  It seems to be an area still in flux, people 
coming up with an open source way to do that that is reliable and easy 
to use and just works.


The main division in current approaches seems to be between: 1) Trying 
to automate _actual browsers_ so you know you've tested it in the real 
browsers you care about (the headaches of this are obvious, but people 
are doing it!), and 2) Using a headless javascript browser that can be 
run right on the server, to test general javascriptyness but without 
testing idiosyncracies of particular browsers (I would lean towards this 
one myself, I'm willing to give up what it gives up for something that 
works a lot simpler with less headaches).


Jonathan

On 1/11/2011 7:21 PM, Bess Sadler 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



Re: [CODE4LIB] javascript testing?

2011-01-12 Thread Demian Katz
For what it's worth, the VuFind community has recently been playing with 
Selenium (not an especially new or exciting technology, I realize...  and 
probably one of the things you were thinking of for approach #1).  The good 
news is that it plays well with Hudson, and we have been able to get it to 
successfully automatically test AJAXy code in Firefox as part of our continuous 
integration process.  The bad news is that it's incredibly slow -- that 
successful test takes ten minutes to execute, and all it does is load one web 
page and confirm that a lightbox opens when a button is clicked.  I wouldn't 
realistically expect this sort of thing to be FAST, but the current performance 
we are experiencing stretches belief a bit -- we're still investigating to see 
if we're doing something wrong that can be improved, but the general consensus 
seems to be that Selenium is just really slow on certain platforms.  It's a 
shame, because I think we could potentially write a very comprehensive!
  and powerful test suite with Selenium...  but tests are significantly less 
valuable if they can't give you reasonably quick feedback while you're in the 
midst of coding!

In any case, I'm happy to share my limited experience with Selenium if it's of 
any use (some VuFind-specific notes are here: 
http://vufind.org/wiki/unit_tests#selenium and more can probably be gleaned by 
looking at VuFind's test-related configuration and scripts).  I'd also be very 
interested to hear if anyone has overcome the speed problems (which I've 
encountered under both RedHat and Ubuntu, possibly related to using a virtual 
frame buffer) or if there is a better, equivalent solution.

- Demian

 -Original Message-
 From: Code for Libraries [mailto:code4...@listserv.nd.edu] On Behalf Of
 Jonathan Rochkind
 Sent: Wednesday, January 12, 2011 11:32 AM
 To: CODE4LIB@LISTSERV.ND.EDU
 Subject: Re: [CODE4LIB] javascript testing?
 
 As far as I can tell, while there are several, there are none that are
 actually Just Work good.  It seems to be an area still in flux, people
 coming up with an open source way to do that that is reliable and easy
 to use and just works.
 
 The main division in current approaches seems to be between: 1) Trying
 to automate _actual browsers_ so you know you've tested it in the real
 browsers you care about (the headaches of this are obvious, but people
 are doing it!), and 2) Using a headless javascript browser that can be
 run right on the server, to test general javascriptyness but without
 testing idiosyncracies of particular browsers (I would lean towards
 this
 one myself, I'm willing to give up what it gives up for something that
 works a lot simpler with less headaches).
 
 Jonathan
 
 On 1/11/2011 7:21 PM, Bess Sadler 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
 


Re: [CODE4LIB] javascript testing?

2011-01-12 Thread Cary Gordon
I have the MyEclipse debugger, but in practice, I don't use it often.
I have used a variety of Javascript dev platforms over the years,
starting with one that was bundled with ColdFusion Studio/Homesite,
and have found that they seem to take more time and effort than they
save.

I do use Firebug in Firefox, which is easy and effective. I have the
Javascript Debugger (nee Venkman) for Firefox, as well, but don't use
that much either. I am not sure what the Javascript capabilities of
Firebug Lite bookmarklet are in other browsers.

Thanks,

Cary

On Tue, Jan 11, 2011 at 4:21 PM, Bess Sadler bess.sad...@gmail.com 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




-- 
Cary Gordon
The Cherry Hill Company
http://chillco.com


Re: [CODE4LIB] javascript testing?

2011-01-12 Thread BRIAN TINGLE
Mark Redar at CDL has some selenium tests for calisphere.org/mapped but they 
are not automatically run

I've been wanting to play around with selenium grid on EC2 but never had the 
time / real reason to -- but if it is as advertised it might speed up running 
the tests by executing them in parallel

http://selenium-grid.seleniumhq.org/
http://selenium-grid.seleniumhq.org/run_the_demo_on_ec2.html

-- Brian

On Jan 12, 2011, at 8:45 AM, Demian Katz wrote:

 For what it's worth, the VuFind community has recently been playing with 
 Selenium (not an especially new or exciting technology, I realize...  and 
 probably one of the things you were thinking of for approach #1).  The good 
 news is that it plays well with Hudson, and we have been able to get it to 
 successfully automatically test AJAXy code in Firefox as part of our 
 continuous integration process.  The bad news is that it's incredibly slow -- 
 that successful test takes ten minutes to execute, and all it does is load 
 one web page and confirm that a lightbox opens when a button is clicked.  I 
 wouldn't realistically expect this sort of thing to be FAST, but the current 
 performance we are experiencing stretches belief a bit -- we're still 
 investigating to see if we're doing something wrong that can be improved, but 
 the general consensus seems to be that Selenium is just really slow on 
 certain platforms.  It's a shame, because I think we could potentially write 
 a very comprehensi!
 ve!
  and powerful test suite with Selenium...  but tests are significantly less 
 valuable if they can't give you reasonably quick feedback while you're in the 
 midst of coding!
 
 In any case, I'm happy to share my limited experience with Selenium if it's 
 of any use (some VuFind-specific notes are here: 
 http://vufind.org/wiki/unit_tests#selenium and more can probably be gleaned 
 by looking at VuFind's test-related configuration and scripts).  I'd also be 
 very interested to hear if anyone has overcome the speed problems (which I've 
 encountered under both RedHat and Ubuntu, possibly related to using a virtual 
 frame buffer) or if there is a better, equivalent solution.
 
 - Demian
 
 -Original Message-
 From: Code for Libraries [mailto:code4...@listserv.nd.edu] On Behalf Of
 Jonathan Rochkind
 Sent: Wednesday, January 12, 2011 11:32 AM
 To: CODE4LIB@LISTSERV.ND.EDU
 Subject: Re: [CODE4LIB] javascript testing?
 
 As far as I can tell, while there are several, there are none that are
 actually Just Work good.  It seems to be an area still in flux, people
 coming up with an open source way to do that that is reliable and easy
 to use and just works.
 
 The main division in current approaches seems to be between: 1) Trying
 to automate _actual browsers_ so you know you've tested it in the real
 browsers you care about (the headaches of this are obvious, but people
 are doing it!), and 2) Using a headless javascript browser that can be
 run right on the server, to test general javascriptyness but without
 testing idiosyncracies of particular browsers (I would lean towards
 this
 one myself, I'm willing to give up what it gives up for something that
 works a lot simpler with less headaches).
 
 Jonathan
 
 On 1/11/2011 7:21 PM, Bess Sadler 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
 


Re: [CODE4LIB] javascript testing?

2011-01-12 Thread Jason Ronallo
I've used Selenium with Cucumber just enough to know that I want to
try it more. I've segregated my tests into non-javascript cucumber
features that run fast and javascript tests that run much slower. I
run the fast tests with autotest as I develop features. Everything
ought to degrade nicely, so I develop these features first. Then as
javascript or ajax features are added, I can manually run the
javascript cucumber features which need Selenium. Not everything needs
to be tested through selenium, so I do not worry so much about the
speed. I haven't used this setup much yet, but so far I like the
workflow.

From this page it looks like you do not need to run jruby to use
culerity. Celerity runs in JRuby, but your application doesn't need
to.
https://github.com/langalex/culerity

Jason

On Tue, Jan 11, 2011 at 7:21 PM, Bess Sadler bess.sad...@gmail.com 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



Re: [CODE4LIB] javascript testing?

2011-01-12 Thread Frank Bennett
For testing of the citeproc-js utility (used in Zotero and Mendeley
bibliography managers), I use the DOH test framework from the Dojo
project.  When running code in Rhino (or other standalone interpreter
such as jslibs/jshost), It provides a command-line test environment,
similar to that used in Python and other scripting languages.  For
citeproc-js development I wanted to have a rapid command-line testing
cycle, and DOH has worked out quite well for that.

  http://dojotoolkit.org/reference-guide/util/doh.html

  
http://www.sitepen.com/blog/2008/04/15/unit-testing-custom-code-with-the-dojo-objective-harness/

  https://bitbucket.org/fbennett/citeproc-js/src

Frank Bennett


Re: [CODE4LIB] javascript testing?

2011-01-11 Thread Gabriel Farrell
I like QUnit because it's minimal and I'm used to unit testing. A lot
of people are jumping on Jasmine, though. It might be more your style
if you're into BDD.

On Tue, Jan 11, 2011 at 7:21 PM, Bess Sadler bess.sad...@gmail.com 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



Re: [CODE4LIB] javascript testing?

2011-01-11 Thread Erik Hatcher
Here at Lucid we've got some Jasmine going on for LWE JS testing. 

Erik

On Jan 11, 2011, at 21:25, Gabriel Farrell gsf...@gmail.com wrote:

 I like QUnit because it's minimal and I'm used to unit testing. A lot
 of people are jumping on Jasmine, though. It might be more your style
 if you're into BDD.
 
 On Tue, Jan 11, 2011 at 7:21 PM, Bess Sadler bess.sad...@gmail.com 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
 


Re: [CODE4LIB] javascript testing?

2011-01-11 Thread Robert Forkel
hi bess,
i've used yui test [1]. with this tool i still had to visit the page
of my test suite manually with a browser, but considering the browser
compatibility issues of javascript, i guess you'll have to do this
anyway.
regards,
robert

[1] http://developer.yahoo.com/yui/yuitest/

On Wed, Jan 12, 2011 at 1:21 AM, Bess Sadler bess.sad...@gmail.com 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