Search in sources :

Example 71 with SWTBotShell

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

the class UITestCase method setupClass.

public void setupClass() throws Exception {
    bot = new SWTWorkbenchBot();
    mainShell = new SWTBotShell(SWTBotUtils.getMainShell());
    System.out.println("mainShell = " + mainShell);
    System.out.println("   with text= " + mainShell.getText());
    defaultTimeOut = SWTBotPreferences.TIMEOUT;
    // SWTBotPreferences.TIMEOUT = 30000; // a bit excessive? But some
    // grails commands take long time.
    // In superclass
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    keyboard = new TestKeyboard(bot);
    // Get rid of artefacts left behind by other badly
    workspaceCleanUp();
    // behaved suites.
    // Cleanup artefacts left behind
    workspaceFileSystemCleanup();
    // in the file system (out of synhc with Eclipse IResources)
    try {
        bot.viewByTitle("Welcome").close();
    } catch (WidgetNotFoundException e) {
    }
    if (!setupClassTried() && !StsTestUtil.isOnBuildSite()) {
        System.out.println("Deleting old screenshots...");
        File screenshotDir = new File("screenshots");
        File[] screenshots = screenshotDir.listFiles();
        if (screenshots != null) {
            for (int i = 0; i < screenshots.length; i++) {
                if (screenshots[i].toString().endsWith(".jpeg")) {
                    screenshots[i].delete();
                }
            }
        }
    }
}
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) File(java.io.File)

Example 72 with SWTBotShell

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

the class UITestCase method closeAllShells.

private static void closeAllShells() {
    Shell mainWidget = SWTBotUtils.getMainShell();
    SWTBotShell[] shells = bot.shells();
    SWTBotShell mainShell = null;
    for (SWTBotShell shell : shells) {
        if (shell.widget != mainWidget) {
            shell.close();
        } else {
            mainShell = shell;
        }
    }
    if (mainShell != null) {
        mainShell.activate();
    }
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Shell(org.eclipse.swt.widgets.Shell) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 73 with SWTBotShell

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

the class StsBotTestUtil method showView.

public static void showView(String category, String view, SWTBot bot) {
    bot.menu("Window").menu("Show View").menu("Other...").click();
    SWTBotShell shell = bot.shell("Show View");
    shell.activate();
    bot.tree().expandNode(category).select(view);
    bot.button("OK").click();
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 74 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project gfm_viewer by satyagraha.

the class ProjectBot method newFile.

public ProjectFileBot newFile(String fileName) {
    projectTree.setFocus();
    projectTree.contextMenu("New").menu("File").click();
    SWTBotShell shell = bot.shell("New File");
    shell.activate();
    bot.textWithLabel("File name:").setText(fileName);
    bot.button("Finish").click();
    SWTUtils.sleep(2000);
    SWTBotTreeItem treeItem = projectTree.getNode(fileName);
    return new ProjectFileBot(treeItem);
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 75 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project gfm_viewer by satyagraha.

the class FileMenuBot method newFile.

public static void newFile(String filename) {
    bot.menu("File").menu("New").menu("File").click();
    SWTBotShell shell = bot.shell("New File");
    shell.activate();
    bot.textWithLabel("File name:").setText(filename);
    bot.button("Finish").click();
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Aggregations

SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)158 Test (org.junit.Test)82 SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)46 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)40 Repository (org.eclipse.jgit.lib.Repository)18 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)11 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)11 File (java.io.File)10 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)9 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)9 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)7 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)7 SWTBotCombo (org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo)7 Path (org.eclipse.core.runtime.Path)6 JobJoiner (org.eclipse.egit.ui.test.JobJoiner)6 Shell (org.eclipse.swt.widgets.Shell)6 SWTBotButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotButton)6 IProject (org.eclipse.core.resources.IProject)5 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)5 ICondition (org.eclipse.swtbot.swt.finder.waits.ICondition)5