use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project eclipse-integration-commons by spring-projects.
the class SWTBotUtils method getConsoleText.
public static String getConsoleText(SWTWorkbenchBot bot) {
SWTBotView console = bot.viewByTitle("Console");
SWTBotStyledText textWidget = console.bot().styledText();
return textWidget.getText();
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project eclipse-integration-commons by spring-projects.
the class UITestCase method openView.
/**
* Opens a particular view, from the Eclipse Window >> Show View menu.
*/
protected SWTBotView openView() {
String category = getProjectViewCategory();
String viewName = getProjectViewName();
SWTBotView explorer = null;
try {
explorer = bot.viewByTitle(viewName);
explorer.setFocus();
} catch (Exception e) {
e.printStackTrace();
SWTBotUtils.menu(bot, "Window").menu("Show View").menu("Other...").click();
SWTBotUtils.selectChildTreeElement(bot, "Show View", category, viewName);
bot.button("OK").click();
explorer = getView();
}
assertTrue(explorer.isActive());
return explorer;
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class SubmoduleFolderTest method testHistoryFromProjectExplorerIsFromSubRepository.
@SuppressWarnings("restriction")
@Test
public void testHistoryFromProjectExplorerIsFromSubRepository() throws Exception {
// Open history view
SWTBotView historyBot = TestUtil.showHistoryView();
IViewPart viewPart = historyBot.getViewReference().getView(false);
assertTrue(viewPart instanceof org.eclipse.team.internal.ui.history.GenericHistoryView);
// Set link with selection
((org.eclipse.team.internal.ui.history.GenericHistoryView) viewPart).setLinkingEnabled(true);
// Select PROJ1 (has 3 commits)
TestUtil.navigateTo(TestUtil.getExplorerTree(), PROJ1).select();
assertRowCountInHistory(PROJ1, 3);
// Select the child folder (from the submodule; has 2 commits)
TestUtil.navigateTo(TestUtil.getExplorerTree(), childFolder.getFullPath().segments()).select();
assertRowCountInHistory(childFolder.getFullPath() + " from submodule", 2);
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class HistoryViewTest method initFilter.
/**
* @param filter
* 0: none, 1: repository, 2: project, 3: folder
* @throws Exception
*/
private void initFilter(int filter) throws Exception {
getHistoryViewTable(PROJ1);
SWTBotView view = bot.viewById(IHistoryView.VIEW_ID);
SWTBotToolbarToggleButton folder = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_AllInParentTooltip);
SWTBotToolbarToggleButton project = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_AllInProjectTooltip);
SWTBotToolbarToggleButton repo = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_AllInRepoTooltip);
switch(filter) {
case 0:
if (folder.isChecked())
folder.click();
if (project.isChecked())
project.click();
if (repo.isChecked())
repo.click();
break;
case 1:
if (!repo.isChecked())
repo.click();
break;
case 2:
if (!project.isChecked())
project.click();
break;
case 3:
if (!folder.isChecked())
folder.click();
break;
default:
break;
}
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class AbstractStagingViewTestCase method selectRepositoryNode.
protected void selectRepositoryNode() throws Exception {
SWTBotView repositoriesView = TestUtil.showView(RepositoriesView.VIEW_ID);
SWTBotTree tree = repositoriesView.bot().tree();
SWTBotTreeItem repoNode = repoViewUtil.getRootItem(tree, repositoryFile);
repoNode.select();
}
Aggregations