views:

169

answers:

1

Hello,

I have a server-code that's written in Python, and I have a client-code that's written with GWT. Now I want to run automation testing on the GWT against the data from the Python server.

From what I searched, people recommends using the Selenium, but I prefer to have a GWT-test that has more visibility into the client-code. That way I can verify the local database, and any data that are not exposed to the UI.

Also at this point I'm not too worried about the DOM aspect, layout, and the other UI stuff.

Is there anyway to make the GWTTest work with external server?

I've tried to search for the solution, or people with similar problem, but I couldn't find one. If this question has been asked previously, I apologize.

Thanks, KOkon.

A: 

You can use the GWTTest framework to incorporate testing some GWT components that call the server. But the tests won't be able to communicate directly with the server. If you need your tests to set up state on the server, I'm afraid you'll need to write special "for testing purposes only" RPC servers or servlets or similar to do it.

Having said that, I would (presumably like those who suggested Selenium) recommend three types of tests:

  1. Unit tests for server components, and unit GWTTests for client components,
  2. Integration tests for testing server code interaction with database, etc.
  3. Selenium acceptance tests, which are "black box" - they don't have access to the innards of the GWT components.
John
Is there a way to create a "proxy" kind of RPC server that can redirect the request to my backend? That way the RPC server code just need to be implemented once.I just don't like the idea of having to duplicate (even though not entirely) functionality of the backend.Thanks for the response.
KOkon
I use java on the server side. In my acceptance tests, I can make a GET request to URL http:/localhost/app/deleteAllDataForTesting?really=yesMy server recognises this call and goes through the process of deleting the data and resetting the server state. It's not an RPC, just a regular http get that my servlet can respond to. It seems to work quite well.
John
Thanks a lot John for the advice. I'll try it on my system.
KOkon