Thanks Dan. I wrote a class to find all the DOM elements with a specified
class name (or names). I wanted to test quite a few different cases and also
test it with a reasonably sized DOM (I have a 2500 element one at the
moment). I can hardly see myself writing the code to create that 2500
elements DOM structure when I did copy/paste it from an existing HTML page
in a few seconds. It would be a nice improvement to be able to inject any
HTML page in the unit tests and the benchmarks. I wanted to do some
benchmarking as well and can't use the GWT benchmark facility either because
of that.

I will put my project in Google Code a bit later.

Cheers,

Fred

On Mon, Jan 26, 2009 at 00:20, Daniel Wellman <[email protected]> wrote:

>
> GWTTestCase runs your test method as a special page inside an
> invisible hosted mode browser.  Unfortunately, that means there's no
> way to specify the HTML that should be used as part of that page.  So
> your instinct was right -- you'll need to set up the code in the DOM
> like demonstrated here:
>
>
> http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideJUnitSetUp
>
> If it's difficult to set up the DOM for the unit test, is there any
> way to simplify what you're testing?  Does the code really need to be
> tested by an automated test, or is it a good candidate for some
> targeted manual testing whenever it changes?
>
> Dan
>
> On Jan 23, 3:22 am, Fred Janon <[email protected]> wrote:
> > I assumed wrongly that the unit tests had access to the HTML page defined
> in
> > the project. I am guessing the page passed to the unit test is minimal.
> Is
> > there a way to get access to a specified HTML page?
> >
> > I am testing some code that goes through the DOM and it is easier for me
> to
> > create an HTML page than creating the DOM structure in the setup routine
> of
> > the unit test.
> >
> > Thanks
> >
> > Fred
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to