Search in sources :

Example 26 with SWTBotView

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

the class DockerImageHierarchyViewSWTBotTest method selectImageInTreeView.

private static SWTBotTreeItem selectImageInTreeView(final SWTWorkbenchBot bot, final String... path) {
    final SWTBotView dockerImageHierarchyViewBot = bot.viewById(DockerImageHierarchyView.VIEW_ID);
    final DockerImageHierarchyView dockerImageHierarchyView = (DockerImageHierarchyView) (dockerImageHierarchyViewBot.getViewReference().getView(true));
    SWTUtils.asyncExec(() -> dockerImageHierarchyView.getCommonViewer().expandAll());
    // containers)
    return SWTUtils.getTreeItem(dockerImageHierarchyViewBot, path).select();
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 27 with SWTBotView

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

the class SVNReporsitoriesView method discardRepository.

/**
 * Select repository
 */
public void discardRepository(String repo) {
    SWTBotView svnRepoView = bot.viewByTitle("SVN Repositories");
    svnRepoView.show();
    svnRepoView.setFocus();
    SWTBotTree tree = svnRepoView.bot().tree();
    tree.select(repo);
    // discard
    clickOnDiscardRepo(tree);
}
Also used : SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 28 with SWTBotView

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

the class PreferencesTest method testProfileProjectActions.

private void testProfileProjectActions(SWTWorkbenchBot bot) throws Exception {
    testPreferencesPage();
    // Focus on project explorer view.
    // $NON-NLS-1$
    SWTBotView projectExplorer = bot.viewByTitle("Project Explorer");
    projectExplorer.bot().tree().select(PROJ_NAME);
    final Shell shellWidget = bot.activeShell().widget;
    // Open profiling configurations dialog
    UIThreadRunnable.asyncExec(() -> {
        DebugUITools.openLaunchConfigurationDialogOnGroup(shellWidget, (StructuredSelection) PlatformUI.getWorkbench().getWorkbenchWindows()[0].getSelectionService().getSelection(), // $NON-NLS-1$
        "org.eclipse.debug.ui.launchGroup.profilee");
    });
    // $NON-NLS-1$
    SWTBotShell shell = bot.shell("Profiling Tools Configurations");
    shell.activate();
    // Create new profiling configuration
    SWTBotTree profilingConfigs = bot.tree();
    // $NON-NLS-1$
    SWTBotTree perfNode = profilingConfigs.select("Profile Timing");
    // $NON-NLS-1$
    perfNode.contextMenu("New").click();
    // $NON-NLS-1$
    bot.button("Profile").click();
    bot.waitUntil(Conditions.shellCloses(shell));
    // Assert that the expected tool is running.
    // $NON-NLS-1$
    SWTBotShell profileShell = bot.shell("Successful profile launch").activate();
    assertNotNull(profileShell);
    // $NON-NLS-1$
    bot.button("Apply and Close").click();
    bot.waitUntil(shellCloses(profileShell));
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Shell(org.eclipse.swt.widgets.Shell) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 29 with SWTBotView

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

the class TestUtils method enterProjectFolder.

/**
 * Enter the project folder so as to avoid expanding trees later
 */
public static SWTBotView enterProjectFolder(SWTWorkbenchBot bot) {
    SWTBotView navigator = bot.viewByTitle(ICreaterepoTestConstants.NAVIGATOR);
    navigator.setFocus();
    navigator.bot().tree().select(ICreaterepoTestConstants.PROJECT_NAME).contextMenu(ICreaterepoTestConstants.GO_INTO).click();
    bot.waitUntil(waitForWidget(WidgetMatcherFactory.withText(ICreaterepoTestConstants.PROJECT_NAME), navigator.getWidget()));
    return navigator;
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 30 with SWTBotView

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

the class AbstractStyledTextViewTest method testPerfView.

@Override
protected void testPerfView() {
    SWTWorkbenchBot bot = new SWTWorkbenchBot();
    Matcher<IViewReference> withPartName = withPartName(getViewId());
    SWTBotView view = bot.view(withPartName);
    assertNotNull(view);
    view.setFocus();
    SWTBotStyledText text = bot.styledText();
    assertNotNull(text);
    assertEquals(getExpectedText(), text.getText());
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBotStyledText(org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText) IViewReference(org.eclipse.ui.IViewReference) 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