[Webtest] Canoo + Grails

david.cate@wachovia.com david.cate@wachovia.com
Wed, 2 Apr 2008 08:38:33 -0400


This is a multipart message in MIME format.
--=_alternative 004572B08525741F_=
Content-Type: text/plain; charset="US-ASCII"

Marc, thank you for the response - got it working beautifully. I've 
noticed that while the Canoo documentation is fairly thorough with the 
exception of the Grails portion and even Grails skips around the 
functional testing portion as well. 

1. Are there any sites or guides that give a good overview of custom 
functional testing for Webtests in Grails?
2. This is just to confirm something: the XML patterns for specifying the 
tests are not available with the Grails plugin - correct? If I create my 
tests within the XML using definitions and entity replacements - I would 
then need to change those tests to use the method described below?




Marc Guillemot <mguillemot@yahoo.fr> 
Sent by: webtest-admin@gate4.canoo.com
04/02/2008 05:34 AM
Please respond to
webtest@gate4.canoo.com


To
webtest@gate4.canoo.com
cc

Subject
Re: [Webtest] Canoo + Grails






Hi,

the mailing list is fully correct.

In Grails you can just extract common step sequences in utility methods 
like

// Utility.groovy
class Utility
{
  doLogin(ant)
  {
    ant.group(description: 'perform login')
    {
      invoke "http://..."
    }
  }
}

// SomeTest.groovy
import static Utility.*
...
webtest('some test')
{
  doLogin(ant)
  ...
}

(my mailer still doesn't compile, syntax error are possible ;-))

When you're utility methods are located directly in your class (or in
some parent class), you don't need to pass ant as parameter.

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com


david.cate@wachovia.com wrote:
> 
> I have Grails running with Canoo Webtest plugin installed. Life is great
> except my tests feel very repetitive. When I used Canoo Webtests
> stand-alone, I used a lot of in-line parsing with the entity and put
> common tests in areas available to all. I know a lot of work was going
> on in the background to make those pieces available. Is there a similar
> process for the plugin for Grails? Is there a different way to include
> common tests?
> 
> This may not the best forum to address the question, if it's not please
> let me know. There's not a whole lot of information that discusses this
> that i could find. I would love to be proven wrong - especially if you
> have the documentation available :)

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest


--=_alternative 004572B08525741F_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Marc, thank you for the response - got
it working beautifully. I've noticed that while the Canoo documentation
is fairly thorough with the exception of the Grails portion and even Grails
skips around the functional testing portion as well. </font>
<br>
<br><font size=2 face="sans-serif">1. Are there any sites or guides that
give a good overview of custom functional testing for Webtests in Grails?</font>
<br><font size=2 face="sans-serif">2. This is just to confirm something:
the XML patterns for specifying the tests are not available with the Grails
plugin - correct? If I create my tests within the XML using definitions
and entity replacements - I would then need to change those tests to use
the method described below?</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Marc Guillemot &lt;mguillemot@yahoo.fr&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: webtest-admin@gate4.canoo.com</font>
<p><font size=1 face="sans-serif">04/02/2008 05:34 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
webtest@gate4.canoo.com</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">webtest@gate4.canoo.com</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [Webtest] Canoo + Grails</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Hi,<br>
<br>
the mailing list is fully correct.<br>
<br>
In Grails you can just extract common step sequences in utility methods
like<br>
<br>
// Utility.groovy<br>
class Utility<br>
{<br>
 &nbsp;doLogin(ant)<br>
 &nbsp;{<br>
 &nbsp; &nbsp;ant.group(description: 'perform login')<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp;invoke &quot;http://...&quot;<br>
 &nbsp; &nbsp;}<br>
 &nbsp;}<br>
}<br>
<br>
// SomeTest.groovy<br>
import static Utility.*<br>
...<br>
webtest('some test')<br>
{<br>
 &nbsp;doLogin(ant)<br>
 &nbsp;...<br>
}<br>
<br>
(my mailer still doesn't compile, syntax error are possible ;-))<br>
<br>
When you're utility methods are located directly in your class (or in<br>
some parent class), you don't need to pass ant as parameter.<br>
<br>
Cheers,<br>
Marc.<br>
-- <br>
Blog: http://mguillem.wordpress.com<br>
<br>
<br>
david.cate@wachovia.com wrote:<br>
&gt; <br>
&gt; I have Grails running with Canoo Webtest plugin installed. Life is
great<br>
&gt; except my tests feel very repetitive. When I used Canoo Webtests<br>
&gt; stand-alone, I used a lot of in-line parsing with the entity and put<br>
&gt; common tests in areas available to all. I know a lot of work was going<br>
&gt; on in the background to make those pieces available. Is there a similar<br>
&gt; process for the plugin for Grails? Is there a different way to include<br>
&gt; common tests?<br>
&gt; <br>
&gt; This may not the best forum to address the question, if it's not please<br>
&gt; let me know. There's not a whole lot of information that discusses
this<br>
&gt; that i could find. I would love to be proven wrong - especially if
you<br>
&gt; have the documentation available :)<br>
<br>
_______________________________________________<br>
WebTest mailing list<br>
WebTest@lists.canoo.com<br>
http://lists.canoo.com/mailman/listinfo/webtest<br>
</tt></font>
<br>
--=_alternative 004572B08525741F_=--