How to unit test GWT + SmartGWT?

I am testing modules on the client side of the GWT + SmartGWT application .

At first I tested using GwtTestCase . Too long for unit testing is a huge application. GwtTestSuite does not help. It still takes too much time to complete. (Moreover, he asked me to launch the browser when testing)

Then gwt-test-utils : Great structure. Unfortunately, my version of javassist is 3.5 and I need at least 3.11. The javassist is used by the hailad, so I cannot touch this. So no gwt-test-utils ...

I saw Selen . This is just great. With the htmlunit driver, it is fast and useful. The easiest way to test webapp. The problem is that SmartGWT generates its own identifiers when creating a web page. Therefore, I cannot get TextItems and populate them, as these identifiers are constantly changing. I found that it can be resolved using setID () before initializing the widget. But this is the scLocator identifier, not the HTML code. Selenium does not want to work with scLocator.

=> Is there an easy way to take scLocator with Selenium? (And when I say simple, it should be simple ... I am not a Java specialist ...)

Can someone help me in a unit test application? It is encoded in Java, it is huge, and I have to cover ~ 70% of the code (lines of 25k code)

Some additional specifications: Maven is used for compilation. I do not touch the server side. Tests should be faster than GwtTestCase and Suite: /

I hope that my problem is clear, I am not my native English, so I apologize for the mistakes that I can make: x

+3
source share
3 answers

<defaultUserExtensionsEnabled> true </DefaultUserExtensionsEnabled>
<userExtensions> [path to user-extensions.js] </UserExtensions>

There we go. I managed to get it to work. (With the selenium-maven plugin in the configuration tag>

Thank you for your help.

0
source

Selenium SDK "selenium" .

3.1d ( smartclient.com/builds), , JUnit.

secureDebugId() ( ). DOM ( ).

Selenium , setID().

+1

, , setID() . scLocator HTML-.

:

widget.ensureDebugId("some-id");

Java DebugId():

, UIObject ID,

0

All Articles