use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project translationstudio8 by heartsome.
the class CreateProjectDemo method createProject.
@Test
public void createProject() throws Exception {
String projectName = "prjBot-001";
bot.menu("File").menu("New").click();
SWTBotShell shell = bot.shell("New");
shell.activate();
// From menu open File > New dialog, verify whether the dialog has been opened.
bot.tree().select("Project");
SWTBotAssert.assertEnabled(bot.button("Next >"));
// After selecting Project, the Next button should be enabled.
bot.button("Next >").click();
bot.textWithLabel("Project name:").setText(projectName);
SWTBotAssert.assertEnabled(bot.button("Finish"));
// Enter the Project Name, then Finish button should be enabled.
bot.button("Finish").click();
SWTBotAssert.assertVisible(bot.tree().select(projectName));
// Click Finish button and verify whether the project's been successfully created.
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project linuxtools by eclipse.
the class PreferencesTest method testPreferencesPage.
@Test
public void testPreferencesPage() {
SWTWorkbenchBot bot = new SWTWorkbenchBot();
// Set default tool for "timing" profiling.
checkDefaultPreference(PROFILING_PREFS_CATEGORY, PROFILING_PREFS_TYPE);
// Open preferences shell.
// $NON-NLS-1$
SWTBotMenu windowsMenu = bot.menu("Window");
// $NON-NLS-1$
windowsMenu.menu("Preferences").click();
// $NON-NLS-1$
SWTBotShell shell = bot.shell("Preferences");
shell.activate();
// Go to "Profiling Categories" preferences page.
bot.text().setText(PROFILING_PREFS_CATEGORY);
bot.waitUntil(new NodeAvailableAndSelect(bot.tree(), "C/C++", "Profiling", "Categories", // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PROFILING_PREFS_CATEGORY));
// Get name of default tool to deselect.
String defaultToolId = ProviderFramework.getProviderIdToRun(null, PROFILING_PREFS_TYPE);
// $NON-NLS-1$
String defaultToolName = ProviderFramework.getToolInformationFromId(defaultToolId, "name");
// Workaround for BZ #344484.
deselectSelectionByName(defaultToolName, bot);
// Assert specified tool to select is what we expect and select it.
SWTBotRadio stubRadio = bot.radio(STUB_LABEL);
assertNotNull(stubRadio);
assertEquals(STUB_TOOLTIP, stubRadio.getToolTipText());
stubRadio.click();
// $NON-NLS-1$
bot.button("Apply").click();
// $NON-NLS-1$
bot.button("Apply and Close").click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project linuxtools by eclipse.
the class CreaterepoPreferencePageTest method openPreferencePage.
/**
* Open the preference page.
*/
private static void openPreferencePage() {
// open the preferences window
bot.menu(ICreaterepoTestConstants.WINDOW).menu(ICreaterepoTestConstants.PREFERENCES).click();
SWTBotShell shell = bot.shell(ICreaterepoTestConstants.PREFERENCES);
shell.activate();
bot.tree().select(ICreaterepoTestConstants.CREATEREPO_CATEGORY);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project linuxtools by eclipse.
the class TestCreateSystemtapScript method cleanUp.
@After
public void cleanUp() {
SWTBotShell[] shells = bot.shells();
for (final SWTBotShell shell : shells) {
String shellTitle = shell.getText();
if (shellTitle.length() > 0 && !shellTitle.startsWith("SystemTap IDE") && !shellTitle.startsWith("Quick Access")) {
UIThreadRunnable.syncExec(() -> {
if (shell.widget.getParent() != null) {
shell.close();
}
});
}
}
bot.closeAllEditors();
mainShell.activate();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell 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();
}
Aggregations