本文整理汇总了Java中org.testfx.matcher.base.NodeMatchers类的典型用法代码示例。如果您正苦于以下问题:Java NodeMatchers类的具体用法?Java NodeMatchers怎么用?Java NodeMatchers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeMatchers类属于org.testfx.matcher.base包,在下文中一共展示了NodeMatchers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testNetworkTableSourceContextMenu
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
@Tag("NonHeadlessTests")
public void testNetworkTableSourceContextMenu() {
NetworkTableInstance inst = NetworkTableInstance.getDefault();
inst.getEntry("/testSourceContextMenu").setString("value");
inst.waitForEntryListenerQueue(-1.0);
WaitForAsyncUtils.waitForFxEvents();
rightClickOn(NodeMatchers.hasText("testSourceContextMenu"));
Node showAsText = lookup(NodeMatchers.hasText("Show as: Text View")).query();
assertNotNull(showAsText);
clickOn(showAsText);
WidgetTile tile = lookup(".tile").query();
assertNotNull(tile);
Widget widget = tile.getContent();
DataSource source = widget.getSources().get(0);
assertTrue(source.isActive());
assertEquals("testSourceContextMenu", source.getName());
assertEquals("value",source.getData());
}
示例2: testShouldCreateNewOperationInPipelineView
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testShouldCreateNewOperationInPipelineView() {
// Given:
clickOn(addOperation.getDescription().name());
WaitForAsyncUtils.waitForFxEvents();
// Then:
final String cssSelector = "." + StyleClassNameUtility.classNameForStepHolding(addOperation
.getDescription());
verifyThat(cssSelector, NodeMatchers.isNotNull());
verifyThat(cssSelector, NodeMatchers.isVisible());
assertEquals(STEP_NOT_ADDED_MSG, 1, pipeline.getSteps().size());
assertEquals("Step added was not this addOperation", AddOperation.DESCRIPTION, pipeline
.getSteps().get(0).getOperationDescription());
}
示例3: testDragOperationFromPaletteToPipeline
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testDragOperationFromPaletteToPipeline() {
// Given:
drag(addOperation.getDescription().name())
.dropTo(".steps");
WaitForAsyncUtils.waitForFxEvents();
// Then:
final String cssSelector = "." + StyleClassNameUtility.classNameForStepHolding(addOperation
.getDescription());
verifyThat(cssSelector, NodeMatchers.isNotNull());
verifyThat(cssSelector, NodeMatchers.isVisible());
assertEquals(STEP_NOT_ADDED_MSG, 1, pipeline.getSteps().size());
assertEquals("Step added was not this addOperation", AddOperation.DESCRIPTION, pipeline
.getSteps().get(0).getOperationDescription());
}
示例4: testDragOperationFromPaletteToLeftOfExistingStep
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testDragOperationFromPaletteToLeftOfExistingStep() {
// Run the same test as before
testDragOperationFromPaletteToPipeline();
// Now add a second step before it
drag(additionOperation.getDescription().name())
// We drag to the input socket hint handle because this will always be on the left side
// of the
// step. This should cause the UI to put the new step on the left side
.dropTo(StyleClassNameUtility.cssSelectorForInputSocketHandleOnStepHolding(addOperation
.getDescription()));
WaitForAsyncUtils.waitForFxEvents();
// Then:
final String cssSelector = "." + StyleClassNameUtility
.classNameForStepHolding(additionOperation.getDescription());
verifyThat(cssSelector, NodeMatchers.isNotNull());
verifyThat(cssSelector, NodeMatchers.isVisible());
assertEquals(STEP_NOT_ADDED_MSG, 2, pipeline.getSteps().size());
assertEquals("Step added was not added in the right place in the pipeline",
AdditionOperation.DESCRIPTION, pipeline.getSteps().get(0).getOperationDescription());
}
示例5: testDragOperationFromPaletteToRightOfExistingStep
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testDragOperationFromPaletteToRightOfExistingStep() {
// Run the same test as before
testDragOperationFromPaletteToPipeline();
// Now add a second step after it
drag(additionOperation.getDescription().name())
// We drag to the output socket hint handle because this will always be on the right side
// of the
// step. This should cause the UI to put the new step on the right side
.dropTo(StyleClassNameUtility.cssSelectorForOutputSocketHandleOnStepHolding(addOperation
.getDescription()));
WaitForAsyncUtils.waitForFxEvents();
// Then:
final String cssSelector = "." + StyleClassNameUtility
.classNameForStepHolding(additionOperation.getDescription());
verifyThat(cssSelector, NodeMatchers.isNotNull());
verifyThat(cssSelector, NodeMatchers.isVisible());
assertEquals(STEP_NOT_ADDED_MSG, 2, pipeline.getSteps().size());
assertEquals("Step added was not added in the right place in the pipeline",
AdditionOperation.DESCRIPTION, pipeline.getSteps().get(1).getOperationDescription());
}
示例6: testCreatesSourceStarted
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testCreatesSourceStarted() throws Exception {
// When
Platform.runLater(() -> addSourceView.getWebcamButton().fire());
WaitForAsyncUtils.waitForFxEvents();
verifyThat("." + AddSourceButton.SOURCE_DIALOG_STYLE_CLASS, NodeMatchers.isVisible());
clickOn("OK");
WaitForAsyncUtils.waitForFxEvents();
// Then
Optional<CameraSource> cameraSource = mockCameraSourceFactory.lastSourceCreated;
assertTrue("A source was not constructed", cameraSource.isPresent());
assertTrue("A source was not created started", cameraSource.get().isRunning());
verifyThat("." + AddSourceButton.SOURCE_DIALOG_STYLE_CLASS, NodeMatchers.isNull());
}
示例7: testCreatesSourceStartedFails
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testCreatesSourceStartedFails() throws Exception {
// When
Platform.runLater(() -> addSourceView.getWebcamButton().fire());
WaitForAsyncUtils.waitForFxEvents();
verifyThat("." + AddSourceButton.SOURCE_DIALOG_STYLE_CLASS, NodeMatchers.isVisible());
clickOn("OK");
WaitForAsyncUtils.waitForFxEvents();
// Then
Optional<CameraSource> cameraSource = mockCameraSourceFactory.lastSourceCreated;
assertTrue("A source was not constructed", cameraSource.isPresent());
assertFalse("A source was not created but should not have been started", cameraSource.get()
.isRunning());
}
示例8: testConnectingTwoOperations
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@SuppressWarnings("PMD.JUnitTestsShouldIncludeAssert")
@Test
public void testConnectingTwoOperations() {
// Given
Step addStep = addOperation(1, additionOperation);
Step subtractStep = addOperation(1, subtractionOperation);
// When
drag(StyleClassNameUtility.cssSelectorForOutputSocketHandleOn(addStep), MouseButton.PRIMARY)
.dropTo(StyleClassNameUtility.cssSelectorForInputSocketHandleOn(subtractStep));
// Then
Connection connection = assertStepConnected("The add step did not connect to the subtract "
+ "step", addStep, subtractStep);
verifyThat(".pipeline", NodeMatchers.hasChildren(1, "."
+ StyleClassNameUtility.classNameFor(connection)));
}
示例9: testEditClassMatching
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
public void testEditClassMatching(){
logger.info("testEditClassMatching started");
CustomGuiTest.waitUntilLoadingWindowIsClosed("Get classes",500);
CustomGuiTest.waitUntilNodeIsVisible("#switchModeButton", timeout);
//Test if manual matching gets loaded
logger.info("Clicking on Button to get Manual Matching");
clickOn("#switchModeButton");
logger.info("Waiting for #sourcePabel to be visible");
CustomGuiTest.waitUntilNodeIsVisible("#sourcePanel", timeout);
verifyThat("#sourcePanel", NodeMatchers.isVisible());
verifyThat("#targetPanel", NodeMatchers.isVisible());
logger.info("Waiting for #switchModeButton to be visible");
CustomGuiTest.waitUntilNodeIsVisible("#switchModeButton", timeout);
logger.info("Clicking on Button to get automated Matching");
//Continue with automated matching
clickOn("#switchModeButton");
logger.info("Waiting for #tableView to be visible");
CustomGuiTest.waitUntilNodeIsVisible("#tableView", timeout);
logger.info("Clicking on tableView");
clickOn("#tableView");
logger.info("Clicking on NEXT");
clickOn("Next");
}
示例10: testVisibility
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testVisibility() {
assertNotNull(mainView.getGraphBuild());
assertNotNull(mainView.toolBox);
verifyThat("#runButton", NodeMatchers.isDisabled());
assertFalse(itemNew.isDisable());
assertFalse(itemLoad.isDisable());
assertFalse(itemExit.isDisable());
assertFalse(itemLayout.isDisable());
assertFalse(itemDelete.isDisable());
assertTrue(itemEdit.isDisable());
assertTrue(itemSave.isDisable());
assertTrue(itemActiveLearning.isDisable());
assertTrue(itemBatchLearning.isDisable());
assertTrue(itemUnsupervisedLearning.isDisable());
}
示例11: testEditClassMatching
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testEditClassMatching() {
logger.info("Clicking on Configuration");
clickOn("Configuration");
logger.info("Clicking on Edit");
clickOn("Edit");
logger.info("Clicking on Classes");
clickOn("Edit Classes");
logger.info("Waiting for classes to be visible");
CustomGuiTest.waitUntilLoadingWindowIsClosed("Get classes",500);
CustomGuiTest.waitUntilNodeIsVisible("Restaurant", 150);
CustomGuiTest.waitUntilNodeIsVisible("Person", 15);
verifyThat("Restaurant", NodeMatchers.isVisible());
verifyThat("Person", NodeMatchers.isVisible());
}
示例12: testDragSingleNetworkTableSourceToWidgetPane
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testDragSingleNetworkTableSourceToWidgetPane() {
NetworkTableInstance inst = NetworkTableInstance.getDefault();
inst.getEntry("/a string source").setString("foo");
inst.waitForEntryListenerQueue(-1.0);
WaitForAsyncUtils.waitForFxEvents();
drag(NodeMatchers.hasText("a string source"), MouseButton.PRIMARY)
.dropTo(".widget-pane");
WidgetTile tile = lookup(".widget-pane .tile").query();
assertNotNull(tile);
}
示例13: testInitialState
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testInitialState() {
verifyThat("#items", hasItems(0));
verifyThat("#addInput", hasText(""));
verifyThat("#selectAll", CheckBoxMatchers.isSelected(false));
verifyThat("#selectAll", NodeMatchers.isInvisible());
verifyThat("#itemsLeftLabel", LabeledMatchers.hasText("0 items left"));
verifyThat("#showAll", ButtonMatchers.isSelected(true));
verifyThat("#showActive", ButtonMatchers.isSelected(false));
verifyThat("#showCompleted", ButtonMatchers.isSelected(false));
}
示例14: testSwitchEditMode
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testSwitchEditMode() throws Exception {
// given
addSomeItems();
verifyThat(getItemContentBox(1), NodeMatchers.isVisible());
verifyThat(getItemEditTextField(1), NodeMatchers.isInvisible());
// when
doubleClickOn(getItemContentBox(1));
// then
verifyThat(getItemContentBox(1), NodeMatchers.isInvisible());
verifyThat(getItemEditTextField(1), NodeMatchers.isVisible());
// when
push(KeyCode.ENTER);
// then
verifyThat(getItemContentBox(1), NodeMatchers.isVisible());
verifyThat(getItemEditTextField(1), NodeMatchers.isInvisible());
// given
doubleClickOn(getItemContentBox(1));
verifyThat(getItemContentBox(1), NodeMatchers.isInvisible());
verifyThat(getItemEditTextField(1), NodeMatchers.isVisible());
// when
clickOn(getItemContentBox(2)); // other label
// then
verifyThat(getItemContentBox(1), NodeMatchers.isVisible());
verifyThat(getItemEditTextField(1), NodeMatchers.isInvisible());
}
示例15: testSelectAllIsInvisibleAfterLastItemIsRemoved
import org.testfx.matcher.base.NodeMatchers; //导入依赖的package包/类
@Test
public void testSelectAllIsInvisibleAfterLastItemIsRemoved() {
// given
clickOn("#addInput");
write("todo0").push(KeyCode.ENTER);
write("todo1").push(KeyCode.ENTER);
verifyThat("#selectAll", NodeMatchers.isVisible());
// when
clickOn(getItemDeleteButton(1));
clickOn(getItemDeleteButton(0));
// then
verifyThat("#selectAll", NodeMatchers.isInvisible());
}