Search in sources :

Example 16 with SWTBotView

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

the class SubmoduleFolderTest method assertRowCountInHistory.

private void assertRowCountInHistory(String msg, int expected) throws Exception {
    SWTBotView historyBot = TestUtil.showHistoryView();
    Job.getJobManager().join(GENERATE_HISTORY, null);
    historyBot.getWidget().getDisplay().syncExec(new Runnable() {

        @Override
        public void run() {
        // Joins UI update triggered by GenerateHistoryJob
        }
    });
    assertEquals(msg + " should show " + expected + " commits", expected, historyBot.bot().table().rowCount());
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 17 with SWTBotView

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

the class GitScopeUtilTest method setup.

@Before
public void setup() throws Exception {
    SWTBotView view = TestUtil.showExplorerView();
    part = view.getViewReference().getPart(false);
    repositoryFile = createProjectAndCommitToRepository();
    GitScopeOperationFactory.setFactory(new GitScopeOperationFactory() {

        @Override
        public GitScopeOperation createGitScopeOperation(IWorkbenchPart workbenchPart, SubscriberScopeManager manager) {
            return new GitScopeOperation(workbenchPart, manager) {

                @Override
                protected boolean promptForInputChange(String requestPreviewMessage, IProgressMonitor monitor) {
                    // we will avoid the confirmation prompt in the tests
                    return false;
                }
            };
        }
    });
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) GitScopeOperationFactory(org.eclipse.egit.ui.internal.operations.GitScopeOperationFactory) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) SubscriberScopeManager(org.eclipse.team.core.subscribers.SubscriberScopeManager) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) GitScopeOperation(org.eclipse.egit.ui.internal.operations.GitScopeOperation) Before(org.junit.Before)

Example 18 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project dsl-devkit by dsldevkit.

the class SwtBotWizardUtil method selectProjectFolder.

/**
 * Select a folder in a project.
 *
 * @param bot
 *          the bot
 * @param folderName
 *          the folder name
 */
public static void selectProjectFolder(final SwtWorkbenchBot bot, final String folderName) {
    SWTBotView packageExplorer = bot.viewByTitle("Project Explorer");
    packageExplorer.show();
    Composite comp = (Composite) packageExplorer.getWidget();
    final Tree tree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), comp);
    PlatformUI.getWorkbench().getDisplay().syncExec(() -> {
        SWTBotTree botTree = new SWTBotTree(tree);
        if (!selectItem(botTree, folderName)) {
            fail("folder was not found");
        }
    });
}
Also used : Composite(org.eclipse.swt.widgets.Composite) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) Tree(org.eclipse.swt.widgets.Tree) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)

Example 19 with SWTBotView

use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project dsl-devkit by dsldevkit.

the class AbstractOutlineViewTest method openOutlineViewOfActiveEditor.

/**
 * Opens the outline view of the currently active editor.
 *
 * @return the {@link SWTBotView} representing the outline view
 * @throw WidgetNotFoundException if there is no active editor
 */
// CHECKSTYLE:CONSTANTS-OFF
protected SWTBotView openOutlineViewOfActiveEditor() {
    getBot().menu("Window").menu("Show View").menu("Outline").click();
    SWTBotView outlineView = getBot().viewById("org.eclipse.ui.views.ContentOutline");
    assertNotNull("outline view present", outlineView);
    SwtBotViewUtil.waitUntilViewIsLoaded(outlineView);
    outlineView.setFocus();
    return outlineView;
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 20 with SWTBotView

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

the class SWTBotUtils method selectProject.

/**
 * Selects a project in the currently opened view. A view must be opened
 * prior to using this method.
 *
 * @param projectName
 * @return
 */
public static SWTBotTree selectProject(SWTWorkbenchBot bot, String projectName, String viewName) {
    SWTBotView explorer = getView(bot, viewName);
    SWTBotTree tree = explorer.bot().tree();
    if (projectName != null) {
        tree.select(projectName);
        waitForSelection(bot, projectName, tree);
        return tree;
    } else {
        tree.select(new String[0]);
        waitForSelection(bot, "", tree);
        return tree;
    }
}
Also used : SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) 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