Tomas Svarovsky's scrapbook

What is happening in Sproutcore world? 2010 May 24

Categories: javascript, Sproutcore, Flot, testing, Capybara

Sprotucore pond might be the small one, but that doesn't mean nothing is happeninng here. During a weekend I have stumbled upon two small frameworks/tools that integrate Sproutcore with other tools. Let's have a brief look at both.

Integration with flot

Flot is a charting library using canvas tag (ext canvas in IE) build upon JQuery. This is a nice fit for sproutcore, since it is built on subset of JQuery. But, how to use Flot in a Sproutcore way? I mean with the views, designs, observables and all the stuff, that we like? Flot integration framework by Bo Xiao to the rescue. You can find it on http://github.com/imxiaobo/iamxiaobo and with this in place, you will get all the goodness I have promised above.

Runing your test automatically, even in Hudson

Javascript is maturing fast, but still is lacking in some ways. That is why (besides other reasons) Sproutcore uses ruby as a language for its dev/testing/deploying tools. Since ruby is super strong in web development, why not to use plethora of its libraries for us as well? This is exactly, what capybara-testrunner by scytacki tries to achieve by using Capybara (basically ruby DSL for controlling browser) to run the tests in your Sproutcore app and make a useful report out of it, so your countinous integration tool can run it automatically and provide useful info on your dashboard.

Part of the tool is also a script, that transforms output to Hudson consumable XML. Thanks to the design of both Sproutcore and Capybara, creating almost any kind of output is a snap. I have tried to create some integration tests (User going to app and click here and there) and it seems pretty straightforward, although it is a little bit annoying to write tests for Sproutcore, since the Capybara DSL is targeted more to HTML pages. Still with a couple of helpers, writing integration tests for Sproutcore could be very easy. Anyone fancy Cucumber like tests for Sprotucore? Not impossible now. Check it out here http://github.com/scytacki/capybara-testrunner

All for today, great work guys, keep on rocking.

Comments

# 1
Web Design Oxford wrote on 15|02|2011:

I'm tempted to get into Sproutcore but so far HTML+CSS+jQuery is ust so good.

Add Comment

(required)
(required, won't be displayed)

(Use Markdown syntax)