Search in sources :

Example 6 with SWTWorkbenchBot

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

the class MetadataPageTest method setUpBeforeClass.

/**
 * Initialize the test project.
 *
 * @throws CoreException
 */
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
    testProject = new TestCreaterepoProject();
    assertTrue(testProject.getProject().exists());
    bot = new SWTWorkbenchBot();
    try {
        bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
    } catch (WidgetNotFoundException e) {
    // cannot activate main shell, continue anyways
    }
    TestUtils.openResourcePerspective(bot);
    navigator = TestUtils.enterProjectFolder(bot);
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) BeforeClass(org.junit.BeforeClass)

Example 7 with SWTWorkbenchBot

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

the class CreaterepoResourceChangeListenerTest method setUpBeforeClass.

/**
 * Initialize the bot.
 */
@BeforeClass
public static void setUpBeforeClass() {
    bot = new SWTWorkbenchBot();
    monitor = new NullProgressMonitor();
    try {
        bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
    } catch (WidgetNotFoundException e) {
    // cannot activate main shell, continue anyways
    }
    TestUtils.openResourcePerspective(bot);
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) BeforeClass(org.junit.BeforeClass)

Example 8 with SWTWorkbenchBot

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

the class CreaterepoGeneralPropertyPageTest method setUpBeforeClass.

/**
 * Initialize the test project.
 *
 * @throws CoreException
 */
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
    testProject = new TestCreaterepoProject();
    assertTrue(testProject.getProject().exists());
    bot = new SWTWorkbenchBot();
    testProject.restoreDefaults();
    try {
        bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
    } catch (WidgetNotFoundException e) {
    // cannot activate main shell, continue anyways
    }
    TestUtils.openResourcePerspective(bot);
    navigator = TestUtils.enterProjectFolder(bot);
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) TestCreaterepoProject(org.eclipse.linuxtools.internal.rpm.createrepo.form.tests.TestCreaterepoProject) BeforeClass(org.junit.BeforeClass)

Example 9 with SWTWorkbenchBot

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

the class CreaterepoPreferencePageTest method setUpBeforeClass.

/**
 * Initialize the test project.
 *
 * @throws CoreException
 */
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
    testProject = new TestCreaterepoProject();
    assertTrue(testProject.getProject().exists());
    bot = new SWTWorkbenchBot();
    testProject.restoreDefaults();
    try {
        bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
    } catch (WidgetNotFoundException e) {
    // cannot activate main shell, continue anyways
    }
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) TestCreaterepoProject(org.eclipse.linuxtools.internal.rpm.createrepo.form.tests.TestCreaterepoProject) BeforeClass(org.junit.BeforeClass)

Example 10 with SWTWorkbenchBot

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

the class TestCreateSystemtapScript method beforeClass.

@BeforeClass
public static void beforeClass() {
    SWTBotPreferences.TIMEOUT = 20000;
    bot = new SWTWorkbenchBot();
    try {
        bot.viewByTitle("Welcome").close();
        // hide Subclipse Usage stats popup if present/installed
        bot.shell("Subclipse Usage").activate();
        bot.button("Cancel").click();
    } catch (WidgetNotFoundException e) {
        // ignore
        e.printStackTrace();
    }
    prepareTreeSettings();
    // Set SystemTap IDE perspective.
    bot.perspectiveByLabel("SystemTap IDE").activate();
    bot.sleep(5000);
    for (SWTBotShell sh : bot.shells()) {
        if (sh.getText().contains("SystemTap IDE")) {
            mainShell = sh;
            sh.activate();
            bot.sleep(500);
            break;
        }
    }
    // Dismiss "Systemtap not installed" dialog(s) if present.
    try {
        SWTBotShell shell = bot.shell("Cannot Run SystemTap").activate();
        shell.close();
        shell = bot.shell("Cannot Run SystemTap").activate();
        shell.close();
    } catch (WidgetNotFoundException e) {
    // ignore
    }
    // Create a Systemtap project.
    clickMainMenu("File", "New", "Project...");
    SWTBotShell shell = bot.shell("New Project");
    shell.setFocus();
    shell.bot().text().setText("Project");
    bot.waitUntil(new NodeAvailableAndSelect(bot.tree(), "General", "Project"));
    bot.button("Next >").click();
    bot.textWithLabel("Project name:").setText(SYSTEMTAP_PROJECT_NAME);
    bot.button("Finish").click();
    bot.waitUntil(Conditions.shellCloses(shell));
    projectExplorer = bot.viewByTitle("Project Explorer");
    projectExplorer.setFocus();
    projectExplorer.bot().tree().select(SYSTEMTAP_PROJECT_NAME).contextMenu("Go Into").click();
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) BeforeClass(org.junit.BeforeClass)

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