class ApplicationLauncherTest extends ApplicationTest {
ApplicationLauncher myapp = new ApplicationLauncher();
@Before
public void setupClass() throws Exception {
ApplicationTest.launch(ApplicationLauncher.class);
}
@After
public void tearDown () throws Exception {
FxToolkit.hideStage();
release(new KeyCode[]{});
release(new MouseButton[]{});
}
@Test
public void clicksButtons() throws Exception {
clickOn("#register");
}
@Override
public void start(javafx.stage.Stage primaryStage) throws Exception {
primaryStage.setTitle("Image Capture");
BorderPane mainWindow = new BorderPane ();
primaryStage.setScene(new Scene(mainWindow));
primaryStage.setHeight(600);
primaryStage.setWidth(600);
primaryStage.centerOnScreen();
primaryStage.show();
}
}
请帮助我更正代码。我对TestFX非常陌生,没有太多可用的示例。