Examples of SWTBotView


Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

        bot.button("OK").click();
        return findById();
    }

    public static MarkdownViewBot findById() {
        SWTBotView gfmView = bot.viewById(gfmViewId); // N.B. waits!
        return new MarkdownViewBot(gfmView);
    }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    waitForWorkspace();
    return bot;
  }
  /** Test if a project exists by checking the Package Explorer View */
  public static void assertProjectExists(SWTWorkbenchBot bot, String projectName) {
    SWTBotView packageExplorer = bot.viewByTitle("Package Explorer");
    SWTBotTree projectsTree = packageExplorer.bot().tree();
    projectsTree.expandNode(projectName);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    assertProjectExistence(PROJ1, true);
    assertEmpty();

    getOrOpenView().show();

    SWTBotView view = TestUtil.showExplorerView();
    SWTBotTree explorerTree = view.bot().tree();
    SWTBotTreeItem projectItem = getProjectItem(explorerTree, PROJ1)
        .select();
    ContextMenuHelper.clickContextMenuSync(explorerTree, "Show In",
        viewName);
    refreshAndWait();
    assertHasRepo(repositoryFile);
    SWTBotTree viewerTree = getOrOpenView().bot().tree();

    TableCollection selection = viewerTree.selection();
    assertTrue("Selection should contain one element",
        selection.rowCount() == 1);
    String nodeText = selection.get(0).get(0);
    assertTrue("Node text should contain project name", projectItem
        .getText().startsWith(nodeText));

    view.show();
    projectItem.expand().getNode(FOLDER).expand().getNode(FILE1).select();

    ContextMenuHelper.clickContextMenuSync(explorerTree, "Show In",
        viewName);
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

        ToggleBranchCommitCommand.TOGGLE_STATE);
    verboseBranchModeState.setValue(Boolean.valueOf(state));
  }

  protected SWTBotView getOrOpenView() throws Exception {
    SWTBotView view = TestUtil.showView(RepositoriesView.VIEW_ID);
    TestUtil.joinJobs(JobFamilies.REPO_VIEW_REFRESH);
    return view;
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    }
    assertTrue("Tree should have item with correct text", found);
  }

  protected void assertEmpty() throws Exception {
    final SWTBotView view = getOrOpenView();
    view.bot().label(UIText.RepositoriesView_messsageEmpty);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    repositoryUtil.addConfiguredRepository(clonedRepositoryFile);
  }

  @Test
  public void testCreateCheckoutDeleteLocalBranch() throws Exception {
    final SWTBotView view = getOrOpenView();
    SWTBotTreeItem localItem = myRepoViewUtil.getLocalBranchesItem(view
        .bot().tree(), repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 1, localItem.getNodes().size());

    assertEquals("master", localItem.getNodes().get(0));
    localItem.getNode(0).select();

    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CreateBranchCommand"));

    SWTBotShell createPage = bot
        .shell(UIText.CreateBranchWizard_NewBranchTitle);
    createPage.activate();
    // getting text with label doesn't work
    createPage.bot().textWithId("BranchName").setText("newLocal");
    createPage.bot().checkBox(UIText.CreateBranchPage_CheckoutButton)
        .deselect();
    createPage.bot().button(IDialogConstants.FINISH_LABEL).click();
    refreshAndWait();

    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 2, localItem.getNodes().size());

    localItem.getNode(0).select();
    assertCheckoutNotAvailable(view);
    localItem.getNode(1).select();
    ContextMenuHelper.clickContextMenuSync(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CheckoutCommand"));
    TestUtil.joinJobs(JobFamilies.CHECKOUT);

    assertCheckoutNotAvailable(view);

    localItem.getNode(0).select();
    ContextMenuHelper.clickContextMenuSync(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CheckoutCommand"));
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
    localItem.getNode(1).select();
    refreshAndWait();
    ContextMenuHelper.clickContextMenuSync(view.bot().tree(), myUtil
        .getPluginLocalizedValue("RepoViewDeleteBranch.label"));
    refreshAndWait();
    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 1, localItem.getNodes().size());
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

            myUtil.getPluginLocalizedValue("CheckoutCommand")));
  }

  @Test
  public void testCreateDeleteLocalBranchWithUnmerged() throws Exception {
    final SWTBotView view = getOrOpenView();
    SWTBotTreeItem localItem = myRepoViewUtil.getLocalBranchesItem(view
        .bot().tree(), repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 1, localItem.getNodes().size());

    assertEquals("master", localItem.getNodes().get(0));
    localItem.getNode(0).select();

    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CreateBranchCommand"));

    SWTBotShell createPage = bot
        .shell(UIText.CreateBranchWizard_NewBranchTitle);
    createPage.activate();
    // getting text with label doesn't work
    createPage.bot().textWithId("BranchName").setText("newLocal");
    createPage.bot().checkBox(UIText.CreateBranchPage_CheckoutButton)
        .select();
    createPage.bot().button(IDialogConstants.FINISH_LABEL).click();
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
    refreshAndWait();

    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 2, localItem.getNodes().size());

    touchAndSubmit("Some more changes");

    localItem.getNode(1).select();
    assertCheckoutNotAvailable(view);
    localItem.getNode(0).select();
    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CheckoutCommand"));
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
    localItem.getNode(1).select();
    refreshAndWait();
    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("RepoViewDeleteBranch.label"));
    SWTBotShell confirmPopup = bot
        .shell(UIText.UnmergedBranchDialog_Title);
    confirmPopup.activate();
    confirmPopup.bot().button(IDialogConstants.OK_LABEL).click();
    refreshAndWait();
    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 1, localItem.getNodes().size());
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    boolean rebase = repo.getConfig().getBoolean(
        ConfigConstants.CONFIG_BRANCH_SECTION, "configTest",
        ConfigConstants.CONFIG_KEY_REBASE, false);
    assertFalse(rebase);

    SWTBotView view = getOrOpenView();

    SWTBotTreeItem localItem = myRepoViewUtil.getLocalBranchesItem(view
        .bot().tree(), clonedRepositoryFile);
    localItem.expand().getNode("configTest").select();

    ContextMenuHelper.clickContextMenuSync(view.bot().tree(),
        myUtil.getPluginLocalizedValue("ShowIn"),
        "Properties");

    SWTBotView propsView = bot.viewByTitle("Properties");
    SWTBotTreeItem rootItem = propsView
        .bot()
        .tree()
        .getTreeItem(
            UIText.BranchPropertySource_UpstreamConfigurationCategory);
    SWTBotTreeItem rebaseItem = rootItem.expand().getNode(
        UIText.BranchPropertySource_RebaseDescriptor);
    assertEquals(UIText.BranchPropertySource_ValueNotSet,
        rebaseItem.cell(1));

    SWTBotTreeItem remoteItem = rootItem.expand().getNode(
        UIText.BranchPropertySource_RemoteDescriptor);
    assertEquals("origin", remoteItem.cell(1));

    SWTBotTreeItem upstreamItem = rootItem.expand().getNode(
        UIText.BranchPropertySource_UpstreamBranchDescriptor);
    assertEquals("refs/heads/master", upstreamItem.cell(1));

    view = getOrOpenView();

    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        clonedRepositoryFile);
    localItem.expand().getNode("configTest").select();

    ContextMenuHelper.clickContextMenu(view.bot().tree(),
        myUtil.getPluginLocalizedValue("ConfigurBranchCommand.label"));

    SWTBotShell configureBranchDialog = bot
        .shell(UIText.BranchConfigurationDialog_BranchConfigurationTitle);
    assertEquals(MessageFormat.format(
        UIText.BranchConfigurationDialog_EditBranchConfigMessage,
        "configTest"), configureBranchDialog.bot().text().getText());
    assertEquals(
        "refs/heads/master",
        configureBranchDialog
            .bot()
            .comboBoxWithLabel(
                UIText.BranchConfigurationDialog_UpstreamBranchLabel)
            .getText());
    assertEquals(
        "origin",
        configureBranchDialog
            .bot()
            .comboBoxWithLabel(
                UIText.BranchConfigurationDialog_RemoteLabel)
            .getText());
    assertFalse(configureBranchDialog.bot()
        .checkBox(UIText.BranchConfigurationDialog_RebaseLabel)
        .isChecked());

    configureBranchDialog.bot()
        .checkBox(UIText.BranchConfigurationDialog_RebaseLabel)
        .select();
    // add a listener to wait for the configuration changed event
    final AtomicBoolean changed = new AtomicBoolean();
    ConfigChangedListener listener =
    new ConfigChangedListener() {
      public void onConfigChanged(ConfigChangedEvent event) {
        changed.set(true);
      }
    };
    ListenerHandle handle = repo.getConfig().addChangeListener(listener);
    // only now click ok
    configureBranchDialog.bot().button("OK").click();

    // cleanup behind ourselves
    handle.remove();
    if (!changed.get())
      fail("We should have received a config change event");

    rebase = repo.getConfig().getBoolean(
        ConfigConstants.CONFIG_BRANCH_SECTION, "configTest",
        ConfigConstants.CONFIG_KEY_REBASE, false);
    assertTrue(rebase);

    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        clonedRepositoryFile);
    localItem.expand().getNode("configTest").select();

    ContextMenuHelper.clickContextMenu(view.bot().tree(),
        myUtil.getPluginLocalizedValue("ShowIn"),
        "Properties");

    propsView = bot.viewByTitle("Properties");
    rootItem = propsView
        .bot()
        .tree()
        .getTreeItem(
            UIText.BranchPropertySource_UpstreamConfigurationCategory);
    rebaseItem = rootItem.expand().getNode(
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile);
    item.select();
    ContextMenuHelper.clickContextMenuSync(tree,
        myUtil.getPluginLocalizedValue("ShowIn"),
        "Properties");
    SWTBotView propertieView = bot.viewById("org.eclipse.ui.views.PropertySheet");
    assertTrue(propertieView.isActive());
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView

    SWTBotTree tree = getOrOpenView().bot().tree();
    myRepoViewUtil.getRootItem(tree, repositoryFile).select();
    // the selection should be root
    assertTrue(tree.selection().get(0, 0).startsWith(REPO1));

    SWTBotView view = TestUtil.showExplorerView();
    SWTBotTree projectExplorerTree = view.bot().tree();

    SWTBotTreeItem item = getProjectItem(projectExplorerTree, PROJ1)
        .expand().getNode(FOLDER).expand().getNode(FILE1);
    view.show();
    item.doubleClick();

    item = getProjectItem(projectExplorerTree, PROJ1).expand()
        .getNode(FOLDER).expand().getNode(FILE2);
    view.show();
    item.doubleClick();
    // now we should have two editors

    // the selection should be still be root
    assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.