Bug 479091: Improve SWTBot menu API and implementation

- Add findMenuItem(...) methods in MenuFinder, to find a single menu
item without creating a list of all matching menu items.

- Send SWT.Arm event before showing a cascade menu and/or returning a
matching menu item in MenuFinder.

- Add findMenuItem() method in ContextMenuFinder.

- Send SWT.Show event when invoking context menu in
ContextMenuFinder.menuBar().

- Update Javadoc of methods in Finder and MenuFinder.

- Add WaitForMenuBar, WaitForPopupMenu and WaitForMenuItem conditions.

- Add new static getter methods for the new conditions in Conditions.

- Send SWT.Show event when invoking context menu in
WaitForPopupMenu.findMatches().

- Add contextMenu() and contextMenu(Control) methods in AbstractSWTBot
to get a widget's popup menu.

- Override contextMenu() in SWTBotTableColumn to get the popup menu from
the correct Control.

- Override contextMenu() in SWTBotTableItem to get the popup menu from
the correct Control.

- Override contextMenu() in SWTBotTreeColumn to get the popup menu from
the correct Control.

- Override contextMenu() in SWTBotTreeItem to get the popup menu from
the correct Control.

- Remove override of contextMenu(String) method in SWTBotTree to use new
API from base class.

- Remove sending of mouse events when invoking context menu in
SWTBotTreeItem.

- Use new API in SWTBotTrayItem.contextMenu(String) method.

- Add SWTBotRootMenu class representing a shell's menu bar or a
control's popup menu.

- Add hide() method in SWTBotMenu to recursively hide a menu item's
parent menus.

- Add hasMenu() method in SWTBotMenu to know if a menu item has a menu.

- Ignore click() on menu item that has a menu in SWTBotMenu.click().

- Invoke hide() before sending the SWT.Selection event in
SWTBotMenu.click(), from the same UI Runnable.

- Add menu(String...) method in SWTBotMenu to recursively get menu items
matching the text path.

- Add menu(String, boolean, int) method in SWTBotMenu to get a specific
menu item index, recursively or not.

- Add menu(Matcher, boolean, int) method in SWTBotMenu to get a menu
item using the specified matcher.

- Add menuWithId(String, String, boolean, int) method in SWTBotMenu to
get a menu item matching the specified key/value pair.

- Add menu() method in SWTBotShell to get the shell's menu bar.

- Add menu() and menu(SWTBotShell) methods in SWTBotFactory to get a
bot's menu bar.

- Use new API in SWTBotFactory.menu(...) methods.

- Use new API in AbstractSWTBot.contextMenu(..., String) methods.

- Use new API in ContextMenuHelper.contextMenu(..., String) methods.

- Use new API for invoking New Project wizard in SWTBotProject.

- Use new API for styled text context menu in SWTBotEclipseEditor.

- Add getTextPath(MenuItem) method in SWTUtils to get the full path
array of text strings of a menu item.

- Add createEvent(Widget) method in SWTUtils.

- Get Delete menu item from the tree's context menu instead of menu bar
in PackageExplorerView.

- Add menu item selection listeners in MenuTab example.

- Rename SWTBotMenuTest2 to SWTBotMenuBarTest.

- Use parameterized test to test both static and dynamic menus in
SWTBotMenuBarTest. 

- Augment tests in SWTBotPopupMenuTest to test new API, recursive find,
selection listeners and SWT events.

- Augment tests in SWTBotMenuBarTest to test new API, recursive find,
selection listeners and SWT events.

- Fix ignored test SWTBotTrayItemTest.menuCanBeAccessedOnTrayItem().

Change-Id: I5bc0c9e5489f74d792889d18428a134ec5387abf
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
29 files changed
tree: fe490e9410560a5385f183f35fa21b33e0b1ee91
  1. artwork/
  2. devtools/
  3. examples/
  4. org.eclipse.swt.examples/
  5. org.eclipse.swtbot/
  6. org.eclipse.swtbot.ant.junit/
  7. org.eclipse.swtbot.e4.finder/
  8. org.eclipse.swtbot.e4.finder.test/
  9. org.eclipse.swtbot.eclipse/
  10. org.eclipse.swtbot.eclipse.core/
  11. org.eclipse.swtbot.eclipse.dsl/
  12. org.eclipse.swtbot.eclipse.finder/
  13. org.eclipse.swtbot.eclipse.finder.test/
  14. org.eclipse.swtbot.eclipse.gef/
  15. org.eclipse.swtbot.eclipse.gef.finder/
  16. org.eclipse.swtbot.eclipse.junit.headless/
  17. org.eclipse.swtbot.eclipse.spy/
  18. org.eclipse.swtbot.eclipse.test.junit/
  19. org.eclipse.swtbot.eclipse.test.junit4/
  20. org.eclipse.swtbot.eclipse.ui/
  21. org.eclipse.swtbot.eclipse.ui.test/
  22. org.eclipse.swtbot.forms/
  23. org.eclipse.swtbot.forms.finder/
  24. org.eclipse.swtbot.forms.finder.test/
  25. org.eclipse.swtbot.generator/
  26. org.eclipse.swtbot.generator.feature/
  27. org.eclipse.swtbot.generator.jdt/
  28. org.eclipse.swtbot.generator.jdt.test/
  29. org.eclipse.swtbot.generator.rules.workbench/
  30. org.eclipse.swtbot.generator.test/
  31. org.eclipse.swtbot.generator.ui/
  32. org.eclipse.swtbot.go/
  33. org.eclipse.swtbot.ide/
  34. org.eclipse.swtbot.junit4_x/
  35. org.eclipse.swtbot.nebula.gallery/
  36. org.eclipse.swtbot.nebula.gallery.finder/
  37. org.eclipse.swtbot.nebula.gallery.finder.test/
  38. org.eclipse.swtbot.releng/
  39. org.eclipse.swtbot.swt.demo/
  40. org.eclipse.swtbot.swt.finder/
  41. org.eclipse.swtbot.swt.finder.test/
  42. org.eclipse.swtbot.swt.finder.test.keyboards/
  43. org.eclipse.swtbot.test/
  44. org.eclipse.swtbot.updatesite/
  45. org.eclipse.ui.forms.examples/
  46. .git-svn-authors
  47. .gitignore
  48. .project
  49. CONTRIBUTING.md
  50. pom.xml
  51. README.md
README.md

SWTBot

SWTBot is a Java API that interacts with SWT by using high-level operations. It is generally use to write UI tests efficiently since the grain of the API is the same grain as UI operation. It makes easier to transform a user scenario to an automated tests.

Documentation & links

http://wiki.eclipse.org/SWTBot

Contributing

GitHub tracker and pull requests are currently not supported by the contribution process.

Please read http://wiki.eclipse.org/SWTBot/Contributing to know how to interact well with the community. For further questions about contributing to SWTBot, please send a mail to swtbot-dev@eclipse.org .