Search in sources :

Example 31 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project eclipse-integration-commons by spring-projects.

the class SWTBotUtils method getConsoleText.

public static String getConsoleText(SWTWorkbenchBot bot) {
    SWTBotView console = bot.viewByTitle("Console");
    SWTBotStyledText textWidget = console.bot().styledText();
    return textWidget.getText();
}
Also used : SWTBotStyledText(org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 32 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project eclipse-integration-commons by spring-projects.

the class UITestCase method openView.

/**
 * Opens a particular view, from the Eclipse Window >> Show View menu.
 */
protected SWTBotView openView() {
    String category = getProjectViewCategory();
    String viewName = getProjectViewName();
    SWTBotView explorer = null;
    try {
        explorer = bot.viewByTitle(viewName);
        explorer.setFocus();
    } catch (Exception e) {
        e.printStackTrace();
        SWTBotUtils.menu(bot, "Window").menu("Show View").menu("Other...").click();
        SWTBotUtils.selectChildTreeElement(bot, "Show View", category, viewName);
        bot.button("OK").click();
        explorer = getView();
    }
    assertTrue(explorer.isActive());
    return explorer;
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) CoreException(org.eclipse.core.runtime.CoreException) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)

Example 33 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.

the class SubmoduleFolderTest method testHistoryFromProjectExplorerIsFromSubRepository.

@SuppressWarnings("restriction")
@Test
public void testHistoryFromProjectExplorerIsFromSubRepository() throws Exception {
    // Open history view
    SWTBotView historyBot = TestUtil.showHistoryView();
    IViewPart viewPart = historyBot.getViewReference().getView(false);
    assertTrue(viewPart instanceof org.eclipse.team.internal.ui.history.GenericHistoryView);
    // Set link with selection
    ((org.eclipse.team.internal.ui.history.GenericHistoryView) viewPart).setLinkingEnabled(true);
    // Select PROJ1 (has 3 commits)
    TestUtil.navigateTo(TestUtil.getExplorerTree(), PROJ1).select();
    assertRowCountInHistory(PROJ1, 3);
    // Select the child folder (from the submodule; has 2 commits)
    TestUtil.navigateTo(TestUtil.getExplorerTree(), childFolder.getFullPath().segments()).select();
    assertRowCountInHistory(childFolder.getFullPath() + " from submodule", 2);
}
Also used : IViewPart(org.eclipse.ui.IViewPart) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) Test(org.junit.Test)

Example 34 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.

the class HistoryViewTest method initFilter.

/**
 * @param filter
 *            0: none, 1: repository, 2: project, 3: folder
 * @throws Exception
 */
private void initFilter(int filter) throws Exception {
    getHistoryViewTable(PROJ1);
    SWTBotView view = bot.viewById(IHistoryView.VIEW_ID);
    SWTBotToolbarToggleButton folder = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_AllInParentTooltip);
    SWTBotToolbarToggleButton project = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_AllInProjectTooltip);
    SWTBotToolbarToggleButton repo = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_AllInRepoTooltip);
    switch(filter) {
        case 0:
            if (folder.isChecked())
                folder.click();
            if (project.isChecked())
                project.click();
            if (repo.isChecked())
                repo.click();
            break;
        case 1:
            if (!repo.isChecked())
                repo.click();
            break;
        case 2:
            if (!project.isChecked())
                project.click();
            break;
        case 3:
            if (!folder.isChecked())
                folder.click();
            break;
        default:
            break;
    }
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) SWTBotToolbarToggleButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton)

Example 35 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.

the class AbstractStagingViewTestCase method selectRepositoryNode.

protected void selectRepositoryNode() throws Exception {
    SWTBotView repositoriesView = TestUtil.showView(RepositoriesView.VIEW_ID);
    SWTBotTree tree = repositoriesView.bot().tree();
    SWTBotTreeItem repoNode = repoViewUtil.getRootItem(tree, repositoryFile);
    repoNode.select();
}
Also used : SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Aggregations

SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)41 SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)14 Test (org.junit.Test)12 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)10 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)7 Repository (org.eclipse.jgit.lib.Repository)3 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)3 Git (org.eclipse.jgit.api.Git)2 Composite (org.eclipse.swt.widgets.Composite)2 Tree (org.eclipse.swt.widgets.Tree)2 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)2 SWTBotStyledText (org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText)2 SWTBotToolbarToggleButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton)2 DockerClient (com.spotify.docker.client.DockerClient)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 IResource (org.eclipse.core.resources.IResource)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IDynamicVariable (org.eclipse.core.variables.IDynamicVariable)1 GitScopeOperation (org.eclipse.egit.ui.internal.operations.GitScopeOperation)1