| Summary: | Ensure UI tests are robust | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Matthias Wienand <matthias.wienand> |
| Component: | GEF MVC | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | nyssen |
| Version: | 1.0.0 | ||
| Target Milestone: | 5.0.0 (Oxygen) M2 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Matthias Wienand
I ensured that all JavaFX dependent code is run on the UI thread by spawning it in a Platform.runLater(). Since many code snippets that need to be run on the UI thread also need to return some value, I implemented helper methods to spawn a runnable with a return value. After applying these fixes, the test code does not throw IllegalStateException("Not on FX application thread") anymore. However, some tests still fail because events are not processed.
Alexander further ensured that all event handles can be registerd on the scene (using MOUSE_ENTERED_TARGET events instead of MOUSE_ENTERED) and implemented waiting for the (un-)registration of event handlers. Moreover, he ensured that all Robot calls are performed from separate threads using EventQueue#invokeLater(). This fixed most of the tests except for FXTypeToolTests.
As some people reported that Robot#moveTo() only leads to event notifications if the mouse is used (i.e. pressing of buttons) afterwards. Therefore, Alexander also changed the setup for FXTypeToolTests so that focus is assigned to the viewer instead of moving the mouse into it. This fixed the FXTypeToolTests.
To sum up, the UI tests can now be run without error on the build server. The code is published on the master and R4_0_maintenance branches. Therefore, I am resolving this ticket as fixed for 4.1.0 M1.
It seems we are not yet there. While locally and on Travis all tests are now stable and successful, on Hudson two tests (those including Robot.mouseMove) now deterministically fail. It seems that Robot.mouseMove is not working correctly on all platforms and we should find a way to get it going on Hudson as well. I replaced the Robot calls with JavaFX event notifications using the JavaFX 8 API. The tests can be run successfully on hudson, travis, and my local machine. The code is published on the master branch, therefore, I resolve this ticket as fixed for 5.0.0 M2. |