开发者

GWT test with external server

开发者 https://www.devze.com 2022-12-16 19:13 出处:网络
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.

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 ma开发者_如何学Goke 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.


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.


What you could do is create a proxy servlet that gets started in the GWTTestCase embedded Jetty instance. That proxy could forward all calls to you real services in Python.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号