Remove excess test template
This commit is contained in:
parent
faddeb4201
commit
ecba05e492
@ -1,44 +0,0 @@
|
|||||||
package app;
|
|
||||||
|
|
||||||
import javafx.scene.Node;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import org.junit.jupiter.api.AfterEach;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.testfx.api.FxToolkit;
|
|
||||||
import org.testfx.framework.junit5.ApplicationTest;
|
|
||||||
import org.testfx.util.WaitForAsyncUtils;
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
|
|
||||||
public class FxTestTemplate extends ApplicationTest {
|
|
||||||
|
|
||||||
private Stage stage;
|
|
||||||
|
|
||||||
@BeforeEach
|
|
||||||
public void runAppToTests() throws Exception {
|
|
||||||
FxToolkit.registerPrimaryStage();
|
|
||||||
FxToolkit.setupApplication(Main::new);
|
|
||||||
FxToolkit.showStage();
|
|
||||||
WaitForAsyncUtils.waitForFxEvents(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterEach
|
|
||||||
public void stopApp() throws TimeoutException {
|
|
||||||
FxToolkit.cleanupStages();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void start(Stage primaryStage){
|
|
||||||
this.stage = primaryStage;
|
|
||||||
primaryStage.toFront();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Stage getStage() {
|
|
||||||
return stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public <T extends Node> T find(final String query) {
|
|
||||||
/** TestFX provides many operations to retrieve elements from the loaded GUI. */
|
|
||||||
return lookup(query).query();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user