Search in sources :

Example 6 with WidgetNotFoundException

use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException 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 7 with WidgetNotFoundException

use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException 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 8 with WidgetNotFoundException

use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException 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 9 with WidgetNotFoundException

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

Example 10 with WidgetNotFoundException

use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.

the class CreaterepoWizardTest method setUpBeforeClass.

/**
 * Setup the bot, monitor and workspace root.
 */
@BeforeClass
public static void setUpBeforeClass() {
    bot = new SWTWorkbenchBot();
    root = ResourcesPlugin.getWorkspace().getRoot();
    monitor = new NullProgressMonitor();
    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) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) BeforeClass(org.junit.BeforeClass)

Aggregations

WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)24 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)12 BeforeClass (org.junit.BeforeClass)12 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 TestCreaterepoProject (org.eclipse.linuxtools.internal.rpm.createrepo.form.tests.TestCreaterepoProject)3 DBManagement (net.heartsome.cat.ts.test.basecase.menu.db.DBManagement)2 InformationDialog (net.heartsome.cat.ts.test.ui.msgdialogs.InformationDialog)2 IWorkspace (org.eclipse.core.resources.IWorkspace)2 IWorkspaceDescription (org.eclipse.core.resources.IWorkspaceDescription)2 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)2 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)2 After (org.junit.After)2 File (java.io.File)1 List (java.util.List)1 Consumer (java.util.function.Consumer)1 InputDialog (net.heartsome.cat.ts.test.ui.dialogs.InputDialog)1 PreTranslateResultDialog (net.heartsome.cat.ts.test.ui.dialogs.PreTranslateResultDialog)1 PreferencesDialog (net.heartsome.cat.ts.test.ui.dialogs.PreferencesDialog)1 IsWidgetInvisible (net.heartsome.test.swtbot.waits.IsWidgetInvisible)1