That actually sounds promising. This may be a dumb question but can anyone 
think of a way to slave the WebDriver and JUNIT together? All I really need 
is to run a JDBC query or a RPC command before each test runs. As long as I 
can get the DB into a known state before running each test all my problems 
go away. I'm willing to try and code the feature (not sure if anyone else 
would ever want it) but I wanted to make sure there wasn't a simpler 
approach I'd over looked. The main reason that I have trouble with using 
WebDriver is that we have heavy usage of TreeGrids and Grids to maintain 
state. I haven't been able to use WebDriver to read data from these objects 
very well because a lot of the state is buried in HTML that may not be 
visible at any time and would have complex XPaths to locate.

Thanks for all the great feedback.

On Monday, May 20, 2013 10:28:34 PM UTC-4, Brian Slesinsky wrote:
>
> I've written a library (not open source) for integration testing but it 
> proved not so popular with my users. There were similar issues: 
> initializing the database is tricky from the browser (it requires a whole 
> different RPC API just for testing), and writing tests of asynchronous code 
> is hard when the tests are async code as well.
>
> With WebDriver, you don't have that problem since the Java code running in 
> a JVM can do a synchronous wait, and you can use JDBC directly. Of course 
> you get other WebDriver-specific problems that are as yet unsolved, like 
> knowing when the app is no longer busy without relying on flaky timeouts.
>
> One possibility is to expose a JavaScript API in your GWT app and call it 
> from WebDriver. There's room for innovation here.
>
>
>
> On Mon, May 20, 2013 at 4:43 PM, <darkl...@aol.com <javascript:>> wrote:
>
>> First off I love using GWT but I have a concern about the current unit 
>> testing available. The JUNIT tests provide a great way to do regression 
>> testing but I find myself lacking an effective way to do integration 
>> testing. I really need a way to make sure that all the layers match up and 
>> work together properly. The way I usually do that on other platforms is 
>> blow away the database before each test, create a standard configuration in 
>> the database, and then perform whatever CRUDs and other operations I want 
>> to test.
>>
>> The issue I have with the GWT unit tests is that since I can't run an 
>> Async request in the beforeMethod I don't have a way of setting up the data 
>> on the back end before I run my test. This means that if the GUI tells me 
>> there are 3 objects in the database right now, I don't really know if 
>> that's correct or not. I think that to run effective integration tests you 
>> need a stable known state in the DB.
>>
>> I've tried managing this in several ways. I attempted to run a long 
>> series of tests in a suite where the first test emptied the database and 
>> created my stable configuration, then subsequent tests would perform CRUDs. 
>> The problem with this was that each test had to be aware of the state all 
>> the proceeding tests had left the DB in. They were very complex and 
>> expensive to maintain and were ultimately abandoned. 
>>
>> I was wondering if anyone had a better solution for how to do this.
>>
>> I was considering trying to add a sister class to GWTTestSuite that would 
>> give  the ability to run a synchronous method on the server during the 
>> beforeMethod and would allow proper setup for subsequent integration 
>> testing.
>>
>> I was hoping someone could tell me how complex this would be and if there 
>> was a reason why GWT did not include this feature. I understand that unit 
>> tests can be run in either native java or javascript but I believe I can 
>> still use java to make an HTTPRequest to the server with expected 
>> parameters. I think having the ability to do proper setup on the backend 
>> before running a test suite would be very valuable. Can anyone give me some 
>> feedback on this idea?
>>
>> Thanks
>>
>> -- 
>> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Contributors" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to 
>> google-web-toolkit-contributors+unsubscr...@googlegroups.com<javascript:>
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to