本文整理汇总了Java中org.testfx.api.FxToolkit.showStage方法的典型用法代码示例。如果您正苦于以下问题:Java FxToolkit.showStage方法的具体用法?Java FxToolkit.showStage怎么用?Java FxToolkit.showStage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testfx.api.FxToolkit
的用法示例。
在下文中一共展示了FxToolkit.showStage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
if (Platform.isFxApplicationThread()) throw new AssertionError("Invalid test state");
Thread.setDefaultUncaughtExceptionHandler(HANDLER);
FxToolkit.registerPrimaryStage();
// FxToolkit.registerStage(() -> new Stage(StageStyle.TRANSPARENT));
FxToolkit.setupSceneRoot(() -> {
if (!Platform.isFxApplicationThread()) throw new AssertionError("Invalid test state");
Thread.currentThread().setUncaughtExceptionHandler(HANDLER);
pane = target.createPane();
pane.setId(ID);
return pane;
});
FxToolkit.setupStage(Window::sizeToScene);
FxToolkit.showStage();
}
示例2: basicBeforeEach
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
/**
* Set up application before each test.
* Afterwards, calls the {@link #beforeEach()} method.
*
* @throws TimeoutException if unable to set up application
* @throws UIInitialisationException if ui was not properly initialized
* @see FxToolkit#setupApplication(Class, String...)
*/
@BeforeEach
public final void basicBeforeEach() throws TimeoutException, UIInitialisationException {
this.primaryStage = FxToolkit.registerPrimaryStage();
this.application = (Hygene) FxToolkit.setupApplication(Hygene.class);
this.context = Hygene.getInstance().getContext();
FxToolkit.showStage();
beforeEach();
}
示例3: setupMainWindowHandle
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
/**
* Encapsulates the primary stage of {@code TestApp} in a {@code MainWindowHandle} and returns it.
*/
public MainWindowHandle setupMainWindowHandle() {
try {
FxToolkit.setupStage((stage) -> {
mainWindowHandle = new MainWindowHandle(stage);
mainWindowHandle.focus();
});
FxToolkit.showStage();
} catch (TimeoutException te) {
throw new AssertionError("Stage takes too long to set up.");
}
return mainWindowHandle;
}
示例4: setUp
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
guiRobot.interact(() -> helpWindow = new HelpWindow());
Stage helpWindowStage = FxToolkit.setupStage((stage) -> stage.setScene(helpWindow.getRoot().getScene()));
FxToolkit.showStage();
helpWindowHandle = new HelpWindowHandle(helpWindowStage);
}
示例5: setUiPart
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
public void setUiPart(final UiPart<? extends Parent> uiPart) {
try {
FxToolkit.setupScene(() -> {
Scene scene = new Scene(uiPart.getRoot());
scene.getStylesheets().setAll(CSS_FILES);
return scene;
});
FxToolkit.showStage();
} catch (TimeoutException te) {
throw new AssertionError("Timeout should not happen.", te);
}
}
示例6: launchApplication
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Test
public void launchApplication() throws Exception {
WaitForAsyncUtils.waitForFxEvents();
when:
//Conditionally executing as the initial dialog box is shown only of
//no repositories are linked with the application
metaDataJSON = new File(io.github.gitfx.util.WorkbenchUtil.GITFX_WORKBENCH_RECENT_REPO_FILE);
if(!metaDataJSON.exists())
clickOn("OK");
FxToolkit.showStage();
then:
//Temprarily these clickOn are also working as asserts for presence of
//UI element. Need to add some more TestFX asserts.
clickOn("#gitsync");
clickOn("#gitclone");
clickOn("#gitinit");
/*clickOn("Cancel");
clickOn("#gitinit");
clickOn("Cancel");*/
clickOn("#gitsync");
/*clickOn("Sync Everything");
clickOn("OK");
clickOn("#gitsync");
clickOn("Sync Everything");
clickOn("Cancel");
clickOn("#gitsync");
clickOn("Particular Repository");
clickOn("OK");
clickOn("Others");
clickOn("Changes");
clickOn("History");*/
}