<?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>andy goundry &#187; Cucumber</title>
	<atom:link href="http://www.andygoundry.com/category/cucumber/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andygoundry.com</link>
	<description>web developer</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:01:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Debugging cucumber scenarios in Rubymine</title>
		<link>http://www.andygoundry.com/2012/02/01/debugging-cucumber-scenarios-in-rubymine/</link>
		<comments>http://www.andygoundry.com/2012/02/01/debugging-cucumber-scenarios-in-rubymine/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 15:52:10 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Rubymine]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false">http://www.andygoundry.com/?p=645</guid>
		<description><![CDATA[Debugging cucumber scenarios in Rubymine is wonderfully simple. Here&#8217;s how i do it:
Create a cucumber step that puts the app into debug mode and pops open the current page that&#8217;s being debugged

I use Rubymine&#8217;s gutter breakpoints, and I add the breakpoint after the save_and_open_page method call, so the page pops open before entering the debugger.
Insert [...]]]></description>
			<content:encoded><![CDATA[<p>Debugging cucumber scenarios in Rubymine is wonderfully simple. Here&#8217;s how i do it:</p>
<h3><span style="font-weight: normal;">Create a cucumber step that puts the app into debug mode and pops open the current page that&#8217;s being debugged</span></h3>
<p><img class="alignnone size-full wp-image-658" title="Screen Shot 2012-02-01 at 16.00.42" src="http://www.andygoundry.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-01-at-16.00.42.png" alt="Screen Shot 2012-02-01 at 16.00.42" width="258" height="62" /></p>
<p>I use Rubymine&#8217;s gutter breakpoints, and I add the breakpoint after the save_and_open_page method call, so the page pops open before entering the debugger.</p>
<h3><span style="font-weight: normal;">Insert the step into whichever scenario i wish to debug</span></h3>
<p><img class="alignnone size-full wp-image-647" title="Screen Shot 2012-02-01 at 15.43.25" src="http://www.andygoundry.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-01-at-15.43.25.png" alt="Screen Shot 2012-02-01 at 15.43.25" width="569" height="71" /></p>
<h3><span style="font-weight: normal;">Run the scenario in debug mode</span></h3>
<p><img class="alignnone size-full wp-image-649" title="Screen Shot 2012-02-01 at 15.48.36" src="http://www.andygoundry.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-01-at-15.48.36.png" alt="Screen Shot 2012-02-01 at 15.48.36" width="355" height="528" /></p>
<h3><span style="font-weight: normal;">Inspect the app&#8217;s objects in Rubymine&#8217;s Watches</span></h3>
<p><img class="alignnone size-full wp-image-648" title="Screen Shot 2012-02-01 at 15.36.27" src="http://www.andygoundry.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-01-at-15.36.27.png" alt="Screen Shot 2012-02-01 at 15.36.27" width="637" height="152" /></p>
<p>Pretty sweet! Super easy and extremely useful.</p>
<p>Rubymine&#8217;s a great app, and i&#8217;m just starting to scratch the surface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygoundry.com/2012/02/01/debugging-cucumber-scenarios-in-rubymine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Cucumber, Webrat and Selenium to test ajax form field validations</title>
		<link>http://www.andygoundry.com/2009/09/04/using-cucumber-webrat-and-selenium-to-test-ajax-form-field-validations/</link>
		<comments>http://www.andygoundry.com/2009/09/04/using-cucumber-webrat-and-selenium-to-test-ajax-form-field-validations/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 18:11:09 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Merb]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Webrat]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.andygoundry.com/?p=439</guid>
		<description><![CDATA[I have an app that fires an ajax request on a form field to validate its contents when I take focus off the field.
I am also using Cucumber, Webrat and Selenium for my integration tests.
I needed my integration tests to test the Ajax responses and the tests weren&#8217;t receiving a response from the Ajax requests.
The [...]]]></description>
			<content:encoded><![CDATA[<p>I have an app that fires an ajax request on a form field to validate its contents when I take focus off the field.</p>
<p>I am also using Cucumber, Webrat and Selenium for my integration tests.</p>
<p>I needed my integration tests to test the Ajax responses and the tests weren&#8217;t receiving a response from the Ajax requests.</p>
<p><strong>The Problem</strong></p>
<p>I found that by simply completing the web form, the ajax request was not being fired and my test was therefore failing when i checked for the existance of the Ajax response. It soon became clear that selenium doesn&#8217;t really interact with the form in the sense of selecting fields and entering values; It simply enters values. As such, the Ajax request was not firing and my test was failing.</p>
<p><strong>The Solution</strong></p>
<p>The solution is Selenium&#8217;s fireEvent method, which you can pass a form field id and the blur method:</p>
<blockquote><p>selenium_session.fireEvent(&#8221;field&#8221;, &#8220;blur&#8221;);</p></blockquote>
<p>In Webrat, this is ever simpler:</p>
<blockquote><p>fire_event(&#8221;field&#8221;,&#8221;blur&#8221;)</p></blockquote>
<p>On using this in a Cucumber step, the ajax is fired as the blur command tells the browser to take focus off the field.</p>
<p>Lovely!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygoundry.com/2009/09/04/using-cucumber-webrat-and-selenium-to-test-ajax-form-field-validations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up Merb, Cucumber and Webrat (and friends) on Snow Leopard</title>
		<link>http://www.andygoundry.com/2009/09/04/setting-up-merb-cucumber-and-webrat-on-snow-leopard-some-good-some-bad/</link>
		<comments>http://www.andygoundry.com/2009/09/04/setting-up-merb-cucumber-and-webrat-on-snow-leopard-some-good-some-bad/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 14:36:06 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Merb]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Webrat]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.andygoundry.com/?p=428</guid>
		<description><![CDATA[
My upgrade to Snow Leopard killed my Merb, Cucumber and Webrat setup so i had to start afresh. That was the bad. The good is that some manual hacks that were required in Leopard are no longer necessary, meaning I can rely on direct gem installations.
Here&#8217;s what i did:

Install Ruby and Gems
Follow instructions on http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/
Install [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>My upgrade to Snow Leopard killed my Merb, Cucumber and Webrat setup so i had to start afresh. That was the bad. The good is that some manual hacks that were required in Leopard are no longer necessary, meaning I can rely on direct gem installations.</p>
<p>Here&#8217;s what i did:</p>
<ol>
<li><strong>Install Ruby and Gems<br />
<span style="font-weight: normal; ">Follow instructions on <a href="http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/">http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/</a></span></strong></li>
<li><strong>Install merb, rspec, cucumber, merb_cucumber and mongrel and dependencies<br />
<span style="font-weight: normal; ">sudo gem install merb rspec cucumber roman-merb_cucumber mongrel term-ansicolor treetop diff-lcs nokogiri do_sqlite3</span></strong></li>
<li><strong>Install webrat<br />
<span style="font-weight: normal;">sudo gem install hoe hpricot webrat</span></strong></li>
<li><strong><span style="font-weight: normal;"><strong>Fix Firefox bug with Snow Leopard<br />
<span style="font-weight: normal;">For some reason the libsqlite3.dylib  library in FireFox 3.5.2 is out of date and breaks cucumber under Snow Leopard. Thankfully, it&#8217;s a simple fix:<br />
mv /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib.orig<br />
cp /usr/lib/libsqlite3.dylib /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib</span></strong></span></strong></li>
<li><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>Install Selenium<br />
<span style="font-weight: normal;">sudo gem install Selenium<br />
sudo gem install selenium-client</span></strong></span></strong></span></strong></li>
<li><strong>Install the textmate cucumber bundle<br />
<span style="font-weight: normal;"><a href="http://github.com/bmabey/cucumber-tmbundle/tree/master">http://github.com/bmabey/cucumber-tmbundle/tree/master</a></span></strong></li>
</ol>
<p><strong>Deprecated Instructions on Snow Leopard that were required on Leopard</strong></p>
<p>The following ugly hacks were required on Leopard with it&#8217;s default Ruby installation. These are no longer required (at least on my machine) on Snow Leopard:</p>
<p><span style="text-decoration: underline;">Manual hack of Selenium</span></p>
<p>http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium</p>
<p>As the instructions recommended replacing the Selemium RC jar file () in the installed gem with one from the Selenium website, i had to find out where the gem had installed. Thankfully, gem -h pointed me toward gem help commands and from there i ran gem environment &#8211; This told me where gems are installed locally and i found that Selemium RC had been installed into /Library/Ruby/Gems/1.8/gems/Selenium-1.1.14/ I replaced as advised and then ran selenium from within the app root and all worked fine, using the replacement. I then downloaded and ran the test selenium code from http://github.com/aslakhellesoy/cucumber/tree/master/examples/selenium running selenium in a different console and then running cucumber examples/selenium/features/ . It worked a treat and booted up selenium as required. Great!</p>
<p><span style="text-decoration: underline;">Manual hack installation of webrat</span></p>
<p>Download http://github.com/gwynm/webrat/tree/master tar file. Git clone doesn&#8217;t work</p>
<p>sudo gem install hoe hpricot<br />
cd downloaded and untarred file<br />
rake gem<br />
sudo gem install pkg/webrat-0.2.1.gem</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.andygoundry.com/2009/09/04/setting-up-merb-cucumber-and-webrat-on-snow-leopard-some-good-some-bad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

