groovy: best way to put config() settings to setUp()

View: New views
7 Messages — Rating Filter:   Alert me  

groovy: best way to put config() settings to setUp()

by aldana :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

throughout my test methods the config settings are repeating and I would
like to put it to the setUp() method (see sample code). put then the
inner webtest closure context is lost and the config setting won't work.

--------------------------------------
void setUp(){
  config(....){...}
}

void test1(){
  webtest(...){....}
}

void test2(){
  webtest(...){....}
}
-----------------------------------

how is it possible to extract the config-settings inside a setup logic?
Looking at the code itself I think it is not possible because the
webtest() context is unknown inside setUp().


--
 manuel aldana
 aldana@...
 software-engineering blog: http://www.aldana-online.de 

_______________________________________________
WebTest mailing list
WebTest@...
http://lists.canoo.com/mailman/listinfo/webtest
manuel aldana
aldana((at))gmx.de
software-engineering blog: http://www.aldana-online.de

Integrating sqlunit Results

by Jonathan Rosenberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I now have sqlunit up & running from within my webtest framework.  But I don't understand if/how I can integrate the output.

I'm hoping there's a way to have the sq;lunit steps show up in place in the HTML output from webtest.

Is this possible?

--
Jonathan Rosenberg
Founder & Executive Director, Tabby's Place
http://www.tabbysplace.org/




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

Re: groovy: best way to put config() settings to setUp()

by aldana :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

manuel aldana wrote:

> hi,
>
> throughout my test methods the config settings are repeating and I
> would like to put it to the setUp() method (see sample code). put then
> the inner webtest closure context is lost and the config setting won't
> work.
>
> --------------------------------------
> void setUp(){
>  config(....){...}
> }
>
> void test1(){
>  webtest(...){....}
> }
>
> void test2(){
>  webtest(...){....}
> }
> -----------------------------------
>
> how is it possible to extract the config-settings inside a setup
> logic? Looking at the code itself I think it is not possible because
> the webtest() context is unknown inside setUp().
>
>
I found a little workaround, which is still forcing a config setting in
each test method, but at least duplicates less stuff.

-----------------------------------
def config={webtestContext ->
  webtestContext.config(...){...}
}

void test1(){
  webtest(...){config(delegate);....}
}

void test2(){
  webtest(...){config(delegate);....}
}
-----------------------------------


--
 manuel aldana
 aldana@...
 software-engineering blog: http://www.aldana-online.de 

_______________________________________________
WebTest mailing list
WebTest@...
http://lists.canoo.com/mailman/listinfo/webtest
manuel aldana
aldana((at))gmx.de
software-engineering blog: http://www.aldana-online.de

Re: Integrating sqlunit Results

by Marc Guillemot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

if you just want to see which sqlunit tasks have been executed, what
about starting them within <webtest> </webtest>?

Cheers,
Marc.
--
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com

Jonathan Rosenberg wrote:

> I now have sqlunit up & running from within my webtest framework.  But I don't understand if/how I can integrate the output.
>
> I'm hoping there's a way to have the sq;lunit steps show up in place in the HTML output from webtest.
>
> Is this possible?
>
> --
> Jonathan Rosenberg
> Founder & Executive Director, Tabby's Place
> http://www.tabbysplace.org/
>
>
>
>
> _______________________________________________
> WebTest mailing list
> WebTest@...
> http://lists.canoo.com/mailman/listinfo/webtest
>

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

Re: groovy: best way to put config() settings to setUp()

by Marc Guillemot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

WebtestCase's webtest method first calls the config method before to
execute the closure, therefore something like that would work (ok,
having to explicitly get ant reference is not so beautiful ;-))
what about this

  void config()
  {
     ant.config(browser: 'FF3')
  }

Cheers,
Marc.
--
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com

manuel aldana wrote:

> manuel aldana wrote:
>> hi,
>>
>> throughout my test methods the config settings are repeating and I
>> would like to put it to the setUp() method (see sample code). put then
>> the inner webtest closure context is lost and the config setting won't
>> work.
>>
>> --------------------------------------
>> void setUp(){
>>  config(....){...}
>> }
>>
>> void test1(){
>>  webtest(...){....}
>> }
>>
>> void test2(){
>>  webtest(...){....}
>> }
>> -----------------------------------
>>
>> how is it possible to extract the config-settings inside a setup
>> logic? Looking at the code itself I think it is not possible because
>> the webtest() context is unknown inside setUp().
>>
>>
> I found a little workaround, which is still forcing a config setting in
> each test method, but at least duplicates less stuff.
>
> -----------------------------------
> def config={webtestContext ->
>  webtestContext.config(...){...}
> }
>
> void test1(){
>  webtest(...){config(delegate);....}
> }
>
> void test2(){
>  webtest(...){config(delegate);....}
> }
> -----------------------------------
>
>

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

RE: Integrating sqlunit Results

by Jonathan Rosenberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marc,

I do that now.  hat I'd like to see is sqlunit HTML output with the same
kind of detail as the webtest HTML.

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place
http://www.tabbysplace.org


-----Original Message-----
From: webtest-admin@... [mailto:webtest-admin@...]
On Behalf Of Marc Guillemot
Sent: Thursday, July 02, 2009 6:25 AM
To: webtest@...
Subject: Re: [Webtest] Integrating sqlunit Results


Hi,

if you just want to see which sqlunit tasks have been executed, what
about starting them within <webtest> </webtest>?

Cheers,
Marc.
--
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com

Jonathan Rosenberg wrote:
> I now have sqlunit up & running from within my webtest framework.  But I
don't understand if/how I can integrate the output.
>
> I'm hoping there's a way to have the sq;lunit steps show up in place in
the HTML output from webtest.

>
> Is this possible?
>
> --
> Jonathan Rosenberg
> Founder & Executive Director, Tabby's Place
> http://www.tabbysplace.org/
>
>
>
>
> _______________________________________________
> WebTest mailing list
> WebTest@...
> http://lists.canoo.com/mailman/listinfo/webtest
>

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

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

Re: Integrating sqlunit Results

by Marc Guillemot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jonathan,

for this purpose, sqlunit needs to save its result files in a way that
can be understood by WebTest :-(

Cheers,
Marc.

Jonathan Rosenberg wrote:

> Marc,
>
> I do that now.  hat I'd like to see is sqlunit HTML output with the same
> kind of detail as the webtest HTML.
>
> --
> Jonathan Rosenberg
> Founder & Executive Director
> Tabby's Place
> http://www.tabbysplace.org
>
>
> -----Original Message-----
> From: webtest-admin@... [mailto:webtest-admin@...]
> On Behalf Of Marc Guillemot
> Sent: Thursday, July 02, 2009 6:25 AM
> To: webtest@...
> Subject: Re: [Webtest] Integrating sqlunit Results
>
>
> Hi,
>
> if you just want to see which sqlunit tasks have been executed, what
> about starting them within <webtest> </webtest>?
>
> Cheers,
> Marc.

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