<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PMA Media Group&#187; javascript</title>
	<atom:link href="http://www.pmamediagroup.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pmamediagroup.com</link>
	<description>Unique Marketing Techniques and Strategies with Guaranteed Results!</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:34:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Culerity and Celerity, JavaScript enabled testing in Cucumber</title>
		<link>http://www.pmamediagroup.com/2009/06/culerity-and-celerity-javascript-enabled-testing-in-cucumber/</link>
		<comments>http://www.pmamediagroup.com/2009/06/culerity-and-celerity-javascript-enabled-testing-in-cucumber/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 23:02:30 +0000</pubDate>
		<dc:creator>fugufish</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[activescaffold]]></category>
		<category><![CDATA[celerity]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[culerity]]></category>
		<category><![CDATA[htmUnit]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=821</guid>
		<description><![CDATA[As you may know, testing JavaScript inesnsive applications using Cucumber can be a pain. There are several ways to handle this; Selenium, Watir and the like. The easiest way I have found however is by using Celerity a jRuby API for htmlUnit, a fully functional headless browser that completely supports JavaScript, and you don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know, testing JavaScript inesnsive applications using Cucumber can be a pain. There are several ways to handle this; Selenium, Watir and the like. The easiest way I have found however is by using <a title="Celerity" href="http://celerity.rubyforge.org/">Celerity</a> a jRuby API for htmlUnit, a fully functional headless browser that completely supports JavaScript, and you don&#8217;t have to serve your application on jRuby to use it!. I was able to get Celerity to play nice duruing Cucumber tests by doing the following:  First, you will need of course jRuby. The Culerity gem will start up Celerity in the jRuby environment, and proxy the actual browser through it. Download <a title="jRuby" href="http://jruby.codehaus.org/">jRuby</a> and extract it to wherever you want it located. In my case I put it in /opt, and set your PATH accordingly.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">export PATH=$HOME<span style="color:#006600; font-weight:bold;">/</span>jruby<span style="color:#006600; font-weight:bold;">/</span>bin:$PATH</pre></div></div>

<p>Next install the Celerity gem in jRuby (we are using the github version rather than the ruby forge version, as it provides a later version):</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">jruby <span style="color:#006600; font-weight:bold;">-</span>S gem install jarib<span style="color:#006600; font-weight:bold;">-</span>celerity <span style="color:#006600; font-weight:bold;">--</span>source=http:<span style="color:#006600; font-weight:bold;">//</span>gems.<span style="color:#9900CC;">github</span>.<span style="color:#9900CC;">com</span></pre></div></div>

<p>Now install the Culerity gem. This provides the interface between Celerity and your environment without forcing you to run in jRuby</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"> gem install langalex<span style="color:#006600; font-weight:bold;">-</span>culerity <span style="color:#006600; font-weight:bold;">--</span>source http:<span style="color:#006600; font-weight:bold;">//</span>gems.<span style="color:#9900CC;">github</span>.<span style="color:#9900CC;">com</span></pre></div></div>

<p>Place this in your test environment:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># config/environments/test.rb</span>
&nbsp;
config.<span style="color:#9900CC;">gem</span> <span style="color:#996600;">&quot;langalex-culerity&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:lib</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#0000FF; font-weight:bold;">false</span></pre></div></div>

<p>I call <code>:lib =&gt; false</code> here to avoid loading the gem. This is done in the file generated by culerity.  Finally remove <code>features/steps/webrat_steps.rb</code> as it will conflict with Culerity, and run:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>generate culerity</pre></div></div>

<p>Enjoy!  Culerity should have very similar syntax to webrat, however keep in mind you may see some differences that you may need to adjust.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/06/culerity-and-celerity-javascript-enabled-testing-in-cucumber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: www.pmamediagroup.com @ 2010-07-31 10:46:03 -->