public Boolean doWithMenuItem() { return showMenuItem(menuPath).isEnabled(); } });
@RobotKeyword("Fails if the given table cell popup menu is enabled.\n" + "Separator for items is ``|``.\n\n" + "Example:\n" + "| `Table Cell Popup Menu Should Be Disabled` | myTable | 1 | 3 | Cell Actions|Clear Cell Value |\n") @ArgumentNames({"identifier", "row", "columnIdentifier", "menuPath"}) public void tableCellPopupMenuShouldBeDisabled(String identifier, String row, String columnIdentifier, String menuPath) { JMenuItemOperator menuItem = getPopupMenuItem(identifier, row, columnIdentifier, menuPath); String errorMessage = "Menuitem '" + menuPath + "' at '" + row + ", " + columnIdentifier + "' is enabled."; Assert.assertFalse(errorMessage, menuItem.isEnabled()); }
@RobotKeyword("Fails if the given table cell popup menu is disabled.\n" + "Separator for items is ``|``.\n\n" + "Example:\n" + "| `Table Cell Popup Menu Should Be Enabled` | myTable | 1 | 3 | Cell Actions|Clear Cell Value |\n") @ArgumentNames({"identifier", "row", "columnIdentifier", "menuPath"}) public void tableCellPopupMenuShouldBeEnabled(String identifier, String row, String columnIdentifier, String menuPath) { JMenuItemOperator menuItem = getPopupMenuItem(identifier, row, columnIdentifier, menuPath); String errorMessage = "Menuitem '" + menuPath + "' at '" + row + ", " + columnIdentifier + "' is disabled."; Assert.assertTrue(errorMessage, menuItem.isEnabled()); }
@RobotKeyword("Selects an item from the menu of the currently selected window " + "and waits for action to finish.\n" + "This keyword will not work, for example, if the menu item opens a dialog.\n\n" + "Example:\n" + "| `Select Window` | My Application |\n" + "| `Select From Menu And Wait` | Tools|Testing|MyTestTool |\n") @ArgumentNames({"menuPath"}) public void selectFromMenuAndWait(String menuPath) { JMenuItemOperator operator = showMenuItem(menuPath); Assert.assertTrue("Menu item '" + menuPath + "' is disabled.", operator.isEnabled()); operator.push(); }
@RobotKeyword("Selects an item from the menu of the currently selected window.\n\n" + "Example:\n" + "| `Select Window` | My Application |\n" + "| `Select From Menu` | Tools|Testing|MyTestTool |\n") @ArgumentNames({"menuPath"}) public void selectFromMenu(String menuPath) { JMenuItemOperator operator = showMenuItem(menuPath); Assert.assertTrue("Menu item '" + menuPath + "' is disabled.", operator.isEnabled()); operator.pushNoBlock(); }
private static Node performTomcatServerAction(String action) { Node asNode = getTomcatServerNode(); asNode.select(); new EventTool().waitNoEvent(10000); String serverIDEName = asNode.getText(); log("ServerNode name = "+serverIDEName); JPopupMenuOperator popup = asNode.callPopup(); if (popup == null) { throw new Error("Cannot get context menu for Tomcat server node "); } boolean startEnabled = popup.showMenuItem(action).isEnabled(); if(startEnabled) { popup.pushMenuNoBlock(action); } return asNode; }
private static Node performTomcatServerAction(String action) { Node asNode = getTomcatServerNode(); asNode.select(); new EventTool().waitNoEvent(10000); String serverIDEName = asNode.getText(); log("ServerNode name = "+serverIDEName); JPopupMenuOperator popup = asNode.callPopup(); if (popup == null) { throw new Error("Cannot get context menu for Tomcat server node "); } boolean startEnabled = popup.showMenuItem(action).isEnabled(); if(startEnabled) { popup.pushMenuNoBlock(action); } return asNode; }