Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
JUnit tests for widgets
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
GWTDeveloper  
View profile  
 More options Jan 29 2009, 12:10 pm
From: GWTDeveloper <haru...@gmail.com>
Date: Thu, 29 Jan 2009 09:10:19 -0800 (PST)
Local: Thurs, Jan 29 2009 12:10 pm
Subject: JUnit tests for widgets
Hi,

I am new to GWT. I wanted to know effective way of testing widgets
like button, listbox, checkbox, anchor, textbox etc.
I have created a widget factory to create these widgets and attach
given listeners.

when i tried writing unit tests, i was facing problems with anchor
element's clicks. Before i jump into selenium to write these tests,
i wanted to know the effective way of testing these widgets. I want to
keep selenium only for testing UI Layout/styles/component placements.

Your inputs are highly appreciated.

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
danox  
View profile  
 More options Jan 29 2009, 5:23 pm
From: danox <danoxs...@gmail.com>
Date: Thu, 29 Jan 2009 14:23:54 -0800 (PST)
Local: Thurs, Jan 29 2009 5:23 pm
Subject: Re: JUnit tests for widgets
The GWT has a test framework that is built on JUnit. Essentially you
create tests and you can then test your widgets as java objects in
your test case. The GWT test case will load up hosted mode under the
covers and run your tests in a GWT environment. A quick read over the
GWT docs should get you started:
http://code.google.com/intl/da/docreader/#p=google-web-toolkit-doc-1-...

On Jan 30, 4:10 am, GWTDeveloper <haru...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hpgabbar  
View profile  
 More options Jan 30 2009, 9:20 am
From: hpgabbar <haru...@gmail.com>
Date: Fri, 30 Jan 2009 06:20:13 -0800 (PST)
Local: Fri, Jan 30 2009 9:20 am
Subject: Re: JUnit tests for widgets
I am using GWTTestCase only, but for elements like Anchor, i am not
able to find a way to fire a click. on button i could do that.
I want to know, whether GWT provides a way a programmatic equivalent
of the user clicking the anchor. It is there for Button.

On Jan 30, 3:23 am, danox <danoxs...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Wellman  
View profile  
 More options Jan 31 2009, 11:38 am
From: Daniel Wellman <etl...@gmail.com>
Date: Sat, 31 Jan 2009 08:38:14 -0800 (PST)
Local: Sat, Jan 31 2009 11:38 am
Subject: Re: JUnit tests for widgets
Unfortunately, the event propagation system doesn't work in
GWTTestCase - so that means you can't send a click() message to a
Button and expect the registered ClickListeners to be notified.  This
means you wouldn't be able to test clicking on an Anchor in a test and
verifying any resulting behavior, even if Anchor supported such a
method - which I'm not sure it does.

I'd recommend moving all the behavior out of any anonymous
ClickListeners and put them onto a "controller" or "presenter" object,
then unit test those classes using standard JUnit test cases.  You
won't be able to verify the callbacks are wired to the correct object,
but in my experience that was easiest to check with some manual
exploratory testing, or some very basic Selenium tests to exercise the
system (without going into exhaustive scenario tests, since these were
easier to test with unit tests).

I've written about my experiences with testing GWT applications here,
if it's helpful:
http://blog.danielwellman.com/2008/11/test-first-gwt-article-in-novem...

Cheers,
Dan

On Jan 30, 9:20 am, hpgabbar <haru...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harun Pathan  
View profile  
 More options Feb 1 2009, 3:07 pm
From: Harun Pathan <haru...@gmail.com>
Date: Mon, 2 Feb 2009 01:37:11 +0530
Local: Sun, Feb 1 2009 3:07 pm
Subject: Re: JUnit tests for widgets

I have the similar kind mechanism used in my application.
Model-View-ControllerI am already doing similar to what you have suggested
in your article. Behaviour in controller.
But wanted to verify attachment of listeners and Widgets done in
WidgetFactory.
I will use selenium for this type of testing.

Thanks for the inputs.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »