<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Cucumber World with Groovy</title>
	<atom:link href="http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/</link>
	<description>A technical blog written by Richard Paul</description>
	<lastBuildDate>Tue, 07 Feb 2012 02:12:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Richard Paul</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-5887</link>
		<dc:creator>Richard Paul</dc:creator>
		<pubDate>Sat, 24 Sep 2011 11:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-5887</guid>
		<description>Hi Phil,

I would recommend using Geb, a groovy library for driving browsers. It sits on top of Selenium.

I talked about it at SkillsMatter a while back, check out:
http://www.rapaul.com/2011/01/26/agile-acceptance-testing-with-geb/
http://skillsmatter.com/podcast/agile-testing/acceptance-testing-with-geb</description>
		<content:encoded><![CDATA[<p>Hi Phil,</p>
<p>I would recommend using Geb, a groovy library for driving browsers. It sits on top of Selenium.</p>
<p>I talked about it at SkillsMatter a while back, check out:<br />
<a href="http://www.rapaul.com/2011/01/26/agile-acceptance-testing-with-geb/" rel="nofollow">http://www.rapaul.com/2011/01/26/agile-acceptance-testing-with-geb/</a><br />
<a href="http://skillsmatter.com/podcast/agile-testing/acceptance-testing-with-geb" rel="nofollow">http://skillsmatter.com/podcast/agile-testing/acceptance-testing-with-geb</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-5868</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Thu, 22 Sep 2011 14:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-5868</guid>
		<description>As a Groovy/Java developer, how do I do things such as creating a browser instance? I&#039;m specifically looking at watir, which my company has used when writing tests in Ruby. We&#039;re looking at using groovy instead, but I&#039;m struggling to find how to interact with rubygems in groovy...</description>
		<content:encoded><![CDATA[<p>As a Groovy/Java developer, how do I do things such as creating a browser instance? I&#8217;m specifically looking at watir, which my company has used when writing tests in Ruby. We&#8217;re looking at using groovy instead, but I&#8217;m struggling to find how to interact with rubygems in groovy&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mixing instances in a Cucumber World &#171; alexcuesta</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-3997</link>
		<dc:creator>Mixing instances in a Cucumber World &#171; alexcuesta</dc:creator>
		<pubDate>Fri, 15 Apr 2011 11:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-3997</guid>
		<description>[...] that I am not mixing an Object as Richard Paul suggested. In my case, I need to get an specific instance of Browser to be used across [...]</description>
		<content:encoded><![CDATA[<p>[...] that I am not mixing an Object as Richard Paul suggested. In my case, I need to get an specific instance of Browser to be used across [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Sondgeroth</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-1198</link>
		<dc:creator>Andrew Sondgeroth</dc:creator>
		<pubDate>Wed, 28 Jul 2010 19:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-1198</guid>
		<description>Thank you, Richard!

I didn&#039;t think properties would be readily available to other steps. But, given what we&#039;re trying to do in our project I thought it might be useful. We seem to be trending towards a monolithic definition file for our tests (vs. lots of copy-paste of similar behavior into separate files). 

I will check out the Google group. I figured there had to be a forum out there somewhere. I just hadn&#039;t come across it. I&#039;ll go bug those guys. :)

Thanks again.</description>
		<content:encoded><![CDATA[<p>Thank you, Richard!</p>
<p>I didn&#8217;t think properties would be readily available to other steps. But, given what we&#8217;re trying to do in our project I thought it might be useful. We seem to be trending towards a monolithic definition file for our tests (vs. lots of copy-paste of similar behavior into separate files). </p>
<p>I will check out the Google group. I figured there had to be a forum out there somewhere. I just hadn&#8217;t come across it. I&#8217;ll go bug those guys. :)</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Paul</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-1197</link>
		<dc:creator>Richard Paul</dc:creator>
		<pubDate>Wed, 28 Jul 2010 19:43:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-1197</guid>
		<description>Ah, I totally missed the variable assignment.  Sharing of variables between step definition files won&#039;t work (I think each file is compiled into a separate class).

If you left the type off the variable it would instead be bound to the script binding and be available in all groovy scripts but I don&#039;t think this is a tidy approach.  I would try to avoid stateful steps, and if they are necessary try to co-locate them in a single step definition file.

It might be better to voice this to a wider audience on the Google group: http://groups.google.com/group/cukes

Cheers,
Richard</description>
		<content:encoded><![CDATA[<p>Ah, I totally missed the variable assignment.  Sharing of variables between step definition files won&#8217;t work (I think each file is compiled into a separate class).</p>
<p>If you left the type off the variable it would instead be bound to the script binding and be available in all groovy scripts but I don&#8217;t think this is a tidy approach.  I would try to avoid stateful steps, and if they are necessary try to co-locate them in a single step definition file.</p>
<p>It might be better to voice this to a wider audience on the Google group: <a href="http://groups.google.com/group/cukes" rel="nofollow">http://groups.google.com/group/cukes</a></p>
<p>Cheers,<br />
Richard</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Sondgeroth</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-1196</link>
		<dc:creator>Andrew Sondgeroth</dc:creator>
		<pubDate>Wed, 28 Jul 2010 19:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-1196</guid>
		<description>Sorry to elaborate on my problem if I have:
//steps.groovy
Then(~”I get (.*)”) { String expected -&gt;
  assert value == expected
}

The error says the property is of course missing in steps2. So, I tried to be clever with something like:

Then(~”I get (.*)”) { String expected -&gt;
assert steps1.value == expected
}

Then it says the property is missing from steps1. (I also tried to use the mixin of the steps1 definition...which also failed).

...My newbie-ness must be blinding.</description>
		<content:encoded><![CDATA[<p>Sorry to elaborate on my problem if I have:<br />
//steps.groovy<br />
Then(~”I get (.*)”) { String expected -&gt;<br />
  assert value == expected<br />
}</p>
<p>The error says the property is of course missing in steps2. So, I tried to be clever with something like:</p>
<p>Then(~”I get (.*)”) { String expected -&gt;<br />
assert steps1.value == expected<br />
}</p>
<p>Then it says the property is missing from steps1. (I also tried to use the mixin of the steps1 definition&#8230;which also failed).</p>
<p>&#8230;My newbie-ness must be blinding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Sondgeroth</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-1195</link>
		<dc:creator>Andrew Sondgeroth</dc:creator>
		<pubDate>Wed, 28 Jul 2010 19:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-1195</guid>
		<description>Wow! Thanks for the prompt response. 

I believe I have the project layout correct. I can reference steps in multiple groovy files with no problem. However, when I try to reference the &#039;value&#039; property in steps1.groovy from steps2.groovy (as noted above) then I get the following error:

groovy.lang.MissingPropertyException: No such property: value for class: steps1 (NativeException)

The &#039;value&#039; property is successfully accessed in the Given and When (in steps1.groovy) but the exception occurs in the Then (in steps2.groovy).

So, I wasn&#039;t sure what the accessibility/scope rules were. More accurately, I wasn&#039;t sure how cucumber was handling multiple files (i.e. do they get aggregated into one class or does it simply &quot;search&quot; through the steps in various definitions until it finds a match). 

Thanks again!</description>
		<content:encoded><![CDATA[<p>Wow! Thanks for the prompt response. </p>
<p>I believe I have the project layout correct. I can reference steps in multiple groovy files with no problem. However, when I try to reference the &#8216;value&#8217; property in steps1.groovy from steps2.groovy (as noted above) then I get the following error:</p>
<p>groovy.lang.MissingPropertyException: No such property: value for class: steps1 (NativeException)</p>
<p>The &#8216;value&#8217; property is successfully accessed in the Given and When (in steps1.groovy) but the exception occurs in the Then (in steps2.groovy).</p>
<p>So, I wasn&#8217;t sure what the accessibility/scope rules were. More accurately, I wasn&#8217;t sure how cucumber was handling multiple files (i.e. do they get aggregated into one class or does it simply &#8220;search&#8221; through the steps in various definitions until it finds a match). </p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Paul</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-1194</link>
		<dc:creator>Richard Paul</dc:creator>
		<pubDate>Wed, 28 Jul 2010 18:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-1194</guid>
		<description>When Cucumber runs it actually collates all the step definitions from all the groovy files into a single source.  So using steps from multiple definition files as you have shown should work.

I will quite often have a step definition file that has common functionality used across many different aspects of the site.  The various scenarios reference them without problem.

Make sure you have the groovy files inside the step_definition directory, check http://github.com/aslakhellesoy/cuke4duke/tree/master/examples/groovy-webdriver/features/ for an example project layout.</description>
		<content:encoded><![CDATA[<p>When Cucumber runs it actually collates all the step definitions from all the groovy files into a single source.  So using steps from multiple definition files as you have shown should work.</p>
<p>I will quite often have a step definition file that has common functionality used across many different aspects of the site.  The various scenarios reference them without problem.</p>
<p>Make sure you have the groovy files inside the step_definition directory, check <a href="http://github.com/aslakhellesoy/cuke4duke/tree/master/examples/groovy-webdriver/features/" rel="nofollow">http://github.com/aslakhellesoy/cuke4duke/tree/master/examples/groovy-webdriver/features/</a> for an example project layout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Sondgeroth</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-1193</link>
		<dc:creator>Andrew Sondgeroth</dc:creator>
		<pubDate>Wed, 28 Jul 2010 17:58:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-1193</guid>
		<description>I&#039;ve been developing in Java for 10 years but I&#039;m as green as cuke when it comes to using Cucumber, JRuby, Groovy and Cuke4Duke.

One (very basic) question I have is how do you reuse/inherit/reference various .groovy files? For example:

//step1.groovy
this.metaClass.mixin(cuke4duke.GroovyDsl)

String value
 	
Given(~&quot;I have the value (.*)&quot;) { String val -&gt; 
    value = val
}
	
When(~&quot;I concatenate (.*)&quot;) { String val -&gt; 
    value += val
}


//steps2.groovy
this.metaClass.mixin(cuke4duke.GroovyDsl)

Then(~&quot;I get (.*)&quot;) { String expected -&gt; 
    //How do I access &#039;value&#039;?
    assert value == expected
}

//some.feature
Feature: fooBar

Scenario: Accessibility
    Given I have the value foo
    When I concatenate Bar
    Then I get fooBar	


Obviously this is a very basic example but as we produce more and more steps/features/scenarios it would be useful to group or reuse some of our step definitions. I can&#039;t seem to find documentation on how to do that and all of my attempts at guessing have failed.

Thanks!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been developing in Java for 10 years but I&#8217;m as green as cuke when it comes to using Cucumber, JRuby, Groovy and Cuke4Duke.</p>
<p>One (very basic) question I have is how do you reuse/inherit/reference various .groovy files? For example:</p>
<p>//step1.groovy<br />
this.metaClass.mixin(cuke4duke.GroovyDsl)</p>
<p>String value</p>
<p>Given(~&#8221;I have the value (.*)&#8221;) { String val -&gt;<br />
    value = val<br />
}</p>
<p>When(~&#8221;I concatenate (.*)&#8221;) { String val -&gt;<br />
    value += val<br />
}</p>
<p>//steps2.groovy<br />
this.metaClass.mixin(cuke4duke.GroovyDsl)</p>
<p>Then(~&#8221;I get (.*)&#8221;) { String expected -&gt;<br />
    //How do I access &#8216;value&#8217;?<br />
    assert value == expected<br />
}</p>
<p>//some.feature<br />
Feature: fooBar</p>
<p>Scenario: Accessibility<br />
    Given I have the value foo<br />
    When I concatenate Bar<br />
    Then I get fooBar	</p>
<p>Obviously this is a very basic example but as we produce more and more steps/features/scenarios it would be useful to group or reuse some of our step definitions. I can&#8217;t seem to find documentation on how to do that and all of my attempts at guessing have failed.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Paul</title>
		<link>http://www.rapaul.com/2010/05/03/cucumber-world-with-groovy/comment-page-1/#comment-897</link>
		<dc:creator>Richard Paul</dc:creator>
		<pubDate>Tue, 04 May 2010 09:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.rapaul.com/?p=518#comment-897</guid>
		<description>Alternatively you can skip the empty World class definition and replace:

&lt;code&gt;
World() {
  World.mixin Greeter, Fareweller
  new World()
}
&lt;/code&gt;

with:

&lt;code&gt;
World() {
  def world = new Object()
  world.metaClass.mixin Greeter, Fareweller
  world
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Alternatively you can skip the empty World class definition and replace:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">World() {<br />
&nbsp; World.mixin Greeter, Fareweller<br />
&nbsp; new World()<br />
}</div></div>
<p>with:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">World() {<br />
&nbsp; def world = new Object()<br />
&nbsp; world.metaClass.mixin Greeter, Fareweller<br />
&nbsp; world<br />
}</div></div>
]]></content:encoded>
	</item>
</channel>
</rss>

