<?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; JavaScript</title>
	<atom:link href="http://www.andygoundry.com/category/javascript/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>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>Sproutcore &#8211; 1st impressions</title>
		<link>http://www.andygoundry.com/2008/10/14/sproutcore-1st-impressions/</link>
		<comments>http://www.andygoundry.com/2008/10/14/sproutcore-1st-impressions/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 12:35:33 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.adveho.net/?p=91</guid>
		<description><![CDATA[Today i had a short play with Sproutcore (the &#8220;Cocoa for the Web&#8221; JS framework used by and optimized by Apple for me.com) for the first time. I was a little surprised with what i found.
 
 
 
 
 
 
The Great

The development tools are in Ruby using the merb framework
The development tools adopt a Rails like MVC architectural pattern, with commands like 

sc-gen model example/contact
sc-gen [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.adveho.net/wp-content/uploads/2008/10/sproutcore.jpg"><img class="size-medium wp-image-93 alignleft" title="sproutcore" src="http://www.adveho.net/wp-content/uploads/2008/10/sproutcore.jpg" alt="" width="285" height="238" /></a>Today i had a short play with Sproutcore (the &#8220;Cocoa for the Web&#8221; JS framework used by and optimized by Apple for me.com) for the first time. I was a little surprised with what i found.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><strong>The Great</strong></p>
<ul>
<li>The development tools are in Ruby using the merb framework</li>
<li>The development tools adopt a Rails like MVC architectural pattern, with commands like </li>
</ul>
<p><span style="font-family: -webkit-monospace; line-height: 18px; white-space: pre;">sc-gen model example/contact</span><br />
<span style="font-family: -webkit-monospace; line-height: 18px; white-space: pre;">sc-gen controller example/detail</span><br />
<span style="font-family: -webkit-monospace; line-height: 18px; white-space: pre;">sc-gen view example/card</span></p>
<div>
<ul>
<li>The development tools include build tools that prepare all JS, HTML and CSS ready to be distributed.
<pre><code>sc-build</code></pre>
</li>
<li>The development tools have a bunch of ruby (rails-style) helpers
<pre><code>&lt;%= button_view :my_button, :label =&gt; 'Here is a functioning button!' %&gt;</code></pre>
</li>
</ul>
<div><strong>The not so great</strong></div>
<ul>
<li>It doesn&#8217;t work with the latest version of Merb (0.9.9 RC1) and doesn&#8217;t appear happy even having it around (even if 0.9.4 is installed, if seems to force a <a href="http://sproutit.lighthouseapp.com/projects/11697/tickets/201-os-x-merb-fatal-error-no-init">removal of 0.9.9 in order to work</a>) &#8211; <a href="http://github.com/lawrencepit/sproutcore-buildtools/commit/f76d745becfaeaca6fae28c9c01719abce2f2cdb">Patch</a> submitted, but only recently.</li>
</ul>
</div>
<div>I&#8217;ll keep playing and posting what i find, plus an app or 2 as i create them.</div>
<div>Check out these links for more info: </div>
<div>
<ul>
<li><a href="http://laurentbois.com/2008/06/16/sproutcore/">http://laurentbois.com/2008/06/16/sproutcore/</a></li>
<li><a href="http://www.sproutcore.com">http://www.sproutcore.com</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.andygoundry.com/2008/10/14/sproutcore-1st-impressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

