コード例 #1
0
 /**
  * Choose Server Popup Menu with specified label on Server with position specified by index
  *
  * @param bot
  * @param index
  * @param menuLabel
  * @param timeOut
  * @param uiTimeOut
  */
 public static void chooseServerPopupMenu(
     SWTWorkbenchBot bot, int index, String menuLabel, long timeOut, long uiTimeOut) {
   SWTEclipseExt swtEclipseExt = new SWTEclipseExt();
   SWTBot servers = swtEclipseExt.showView(ViewType.SERVERS);
   SWTBotTree serverTree = servers.tree();
   ContextMenuHelper.prepareTreeItemForContextMenu(serverTree, index);
   SWTTestExt.util.waitForAll(uiTimeOut);
   SWTBotMenu menu =
       new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, menuLabel, false));
   SWTTestExt.util.waitForAll(uiTimeOut);
   menu.click();
   SWTTestExt.util.waitForAll(timeOut);
 }
コード例 #2
0
  /** Test show type action on VSM and hide type action. */
  public void testShowHideTypeAction() {
    SWTBotView projectExplorer = bot.viewByTitle("Model Explorer");
    projectExplorer.setFocus();
    projectExplorer.bot().tree().expandNode(getProjectName()).expandNode(VSM_FILE).doubleClick();
    SWTBotEditor activeEditor = bot.activeEditor();
    activeEditor.setFocus();

    String nodeLabel = "platform:/resource/" + getProjectName() + "/" + VSM_FILE;
    SWTBotMenu contextualMenu =
        activeEditor
            .bot()
            .tree()
            .expandNode(nodeLabel)
            .expandNode(GROUP)
            .expandNode(VIEWPOINT_NAME)
            .expandNode(REPRESENTATION_NAME)
            .contextMenu(SHOW_TYPE);
    contextualMenu.click();
    contextualMenu =
        activeEditor
            .bot()
            .tree()
            .expandNode(nodeLabel)
            .expandNode(TYPED_GROUP)
            .expandNode(TYPED_VIEWPOINT_NAME)
            .expandNode(TYPED_REPRESENTATION_NAME)
            .contextMenu(HIDE_TYPE);
    contextualMenu.click();
    contextualMenu =
        activeEditor
            .bot()
            .tree()
            .expandNode(nodeLabel)
            .expandNode(GROUP)
            .expandNode(VIEWPOINT_NAME)
            .expandNode(REPRESENTATION_NAME)
            .contextMenu(SHOW_TYPE);
  }