I've got 2 testfx tests which each run successfully but when run in series, fail. The error message is:
--- Exception in Async Thread ---
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Cannot set style once stage has been set visible
java.util.concurrent.FutureTask.report(FutureTask.java:122)
...
I initialised the test by creating the stage:
@Before
public void setUp() throws Exception {
FxToolkit.registerPrimaryStage();
setupStage((stage -> {
Undecorator undecorator;
....
It seems that the thread isn't letting go of the stage the first time round. I've tried several things from the testfx forum to kill it before the second test starts including FxToolkit.hideStage();
and Platform.exit();
.
I'm using org.testfx:testfx-junit:4.0.6-alpha
. Any thoughts?
Thanks, Andy