Search in sources :

Example 31 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.

the class AbstractSWTBotTest method runPerfViewTest.

@Test
public void runPerfViewTest() throws Exception {
    SWTWorkbenchBot bot = new SWTWorkbenchBot();
    /*
         * - Method returns when the build is complete -
         * AbstractTest#createProjectAndBuild builds a single executable binary
         * under "Binaries".
         */
    proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), PROJ_NAME);
    try {
        runPerfViewTestActions(bot);
    } catch (Exception e) {
        throw e;
    } finally {
        deleteProject(proj);
    }
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) Test(org.junit.Test) AbstractTest(org.eclipse.linuxtools.profiling.tests.AbstractTest)

Example 32 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot 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)

Example 33 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project eclipse-pmd by acanda.

the class JavaProjectClient method createJavaProject.

/**
 * Creates a Java project with the provided name.
 *
 * @param name The name of the Java project.
 */
public static void createJavaProject(final String name) {
    final SWTWorkbenchBot bot = new SWTWorkbenchBot();
    bot.menu("File").menu("New").menu("Project...").click();
    final SWTBotShell dialog = bot.shell("New Project");
    final SWTBot newProjectDialogBot = dialog.bot();
    final SWTBotTree projectTree = newProjectDialogBot.tree();
    projectTree.expandNode("Java", "Java Project").select();
    newProjectDialogBot.button("Next >").click();
    newProjectDialogBot.textWithLabel("Project name:").setText(name);
    newProjectDialogBot.button("Finish").click();
    bot.waitUntil(Conditions.shellCloses(dialog));
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 34 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project eclipse-pmd by acanda.

the class JavaProjectClient method deleteJavaProject.

/**
 * Deletes the project with the provided name.
 *
 * @param name The name of the project.
 */
public static void deleteJavaProject(final String name) {
    final SWTWorkbenchBot bot = new SWTWorkbenchBot();
    bot.viewById("org.eclipse.jdt.ui.PackageExplorer").bot().tree().getTreeItem(name).contextMenu("Delete").click();
    final SWTBotShell dialog = bot.shell("Delete Resources");
    final SWTBot dialogBot = dialog.bot();
    dialogBot.checkBox().select();
    dialogBot.button("OK").click();
    bot.waitUntil(Conditions.shellCloses(dialog));
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 35 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project eclipse-pmd by acanda.

the class JavaProjectClient method openPMDPropertyDialog.

/**
 * Opens the PMD property dialog of the project with the provided name.
 *
 * @param name The name of the project.
 * @return A bot for the open PMD property dialog.
 */
public static PMDPropertyDialogBot openPMDPropertyDialog(final String name) {
    final SWTWorkbenchBot bot = new SWTWorkbenchBot();
    bot.viewById("org.eclipse.jdt.ui.PackageExplorer").bot().tree().getTreeItem(name).select();
    bot.menu("File").menu("Properties").click();
    final PMDPropertyDialogBot dialog = new PMDPropertyDialogBot(bot.shell("Properties for " + name).widget);
    dialog.bot().tree().getTreeItem("PMD").select();
    return dialog;
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) PMDPropertyDialogBot(ch.acanda.eclipse.pmd.swtbot.bot.PMDPropertyDialogBot)

Aggregations

SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)37 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)15 BeforeClass (org.junit.BeforeClass)15 Test (org.junit.Test)10 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)8 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)5 AbstractRefactoringSwtBotTest (org.eclipse.xtend.ide.tests.AbstractRefactoringSwtBotTest)5 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)5 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)4 SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 SWTUtils (org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils)3 Before (org.junit.Before)3 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 IWorkspace (org.eclipse.core.resources.IWorkspace)2 IWorkspaceDescription (org.eclipse.core.resources.IWorkspaceDescription)2