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();
}
}
}
}
}
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();
}
}
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();
}
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);
}
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();
}
Aggregations