Package org.fest.swing.driver
Class JMenuItemDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JMenuItemDriver
Understands functional testing of
JMenuItems:
- user input simulation
- state verification
- property value query
org.fest.swing.fixture in your tests.-
Field Summary
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidactivateParentIfIsAMenu(JMenuItemLocation location) voidFinds and selects the given.JMenuItemprivate voidprivate voidensurePopupIsShowing(JMenuItem menuItem) private booleanprivate static JMenuItemLocationlocationOf(JMenuItem menuItem) private voidmoveParentWindowToFront(JMenuItemLocation location) private voidprivate voidprivate static voidvalidateAndDoClick(JMenuItem menuItem) private voidMethods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibleMethods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidthMethods inherited from class org.fest.swing.driver.ComponentDriver
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
-
Constructor Details
-
JMenuItemDriver
Creates a newJMenuItemDriver.- Parameters:
robot- the robot to use to simulate user input.
-
-
Method Details
-
click
Finds and selects the given.JMenuItem- Parameters:
menuItem- theJMenuItemto select.- Throws:
IllegalStateException- if the menu to select is disabled.IllegalStateException- if the menu to select is not showing on the screen.ActionFailedException- if the menu has a pop-up and it fails to show up.
-
show
-
locationOf
-
activateParentIfIsAMenu
-
moveParentWindowToFront
-
doClick
-
isMacOSMenuBar
private boolean isMacOSMenuBar() -
validateAndDoClick
-
ensurePopupIsShowing
-
waitForSubMenuToShow
private void waitForSubMenuToShow() -
moveToFront
-