Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

SmartGWT Unit Testing Framework

$
0
0
Okay so I've been doing research on this topic for about a week now.

Based on everything I've read and tried to do unit testing properly we basically have create a unit testing framework in GWT, something akin to JUnit. Then we use Selenium to do the basic check to see if the test was passed or not.

Something similar to what you have in the showcase when the autotest flag is set:
http://www.smartclient.com/smartgwt/...tured_category

Other options include:
Mocking 'broken' SGWT classes in GWTTestCase
Put extensive work to 'push' methods up to a point where they are visible to Selenium

So the question is, is there another option? Creating a JUnit like testing framework in SGWT is viable but non-trivial, do you have any suggestions on how to create such a framework? It seems like Isomorphic already has a relatively robust testing framework.

Also what is this 'runStyle' option in GWT? I tried it out in Eclipse but it didn't seem to do anything, could you explain in a little more detail?

Thanks!

Related post:
Quote:

Originally Posted by Isomorphic (Post 83482)
We don't have a specific recommendation as we use something proprietary. However for non-unit tests that simulate user actions, we do recommend Selenium and have special support for it (see the Automated Testing overview in the SmartClient Reference).

Quote:

Originally Posted by Isomorphic (Post 79008)
This may suggest that GwtTestCase, which uses a fake HTMLUnit browser, cannot be used to run tests involving XML manipulation since it isn't a real browser.

There is a notion of runStyle which might be used to force the test to run in a real browser.

However, because of issues like the above we recommend focusing on Selenium testing rather than GwtTestCase.

Related Docs:
http://www.smartclient.com/smartgwte...edTesting.html

Viewing all articles
Browse latest Browse all 4756

Trending Articles