use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class SubmoduleFolderTest method assertRowCountInHistory.
private void assertRowCountInHistory(String msg, int expected) throws Exception {
SWTBotView historyBot = TestUtil.showHistoryView();
Job.getJobManager().join(GENERATE_HISTORY, null);
historyBot.getWidget().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
// Joins UI update triggered by GenerateHistoryJob
}
});
assertEquals(msg + " should show " + expected + " commits", expected, historyBot.bot().table().rowCount());
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class GitScopeUtilTest method setup.
@Before
public void setup() throws Exception {
SWTBotView view = TestUtil.showExplorerView();
part = view.getViewReference().getPart(false);
repositoryFile = createProjectAndCommitToRepository();
GitScopeOperationFactory.setFactory(new GitScopeOperationFactory() {
@Override
public GitScopeOperation createGitScopeOperation(IWorkbenchPart workbenchPart, SubscriberScopeManager manager) {
return new GitScopeOperation(workbenchPart, manager) {
@Override
protected boolean promptForInputChange(String requestPreviewMessage, IProgressMonitor monitor) {
// we will avoid the confirmation prompt in the tests
return false;
}
};
}
});
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project dsl-devkit by dsldevkit.
the class SwtBotWizardUtil method selectProjectFolder.
/**
* Select a folder in a project.
*
* @param bot
* the bot
* @param folderName
* the folder name
*/
public static void selectProjectFolder(final SwtWorkbenchBot bot, final String folderName) {
SWTBotView packageExplorer = bot.viewByTitle("Project Explorer");
packageExplorer.show();
Composite comp = (Composite) packageExplorer.getWidget();
final Tree tree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), comp);
PlatformUI.getWorkbench().getDisplay().syncExec(() -> {
SWTBotTree botTree = new SWTBotTree(tree);
if (!selectItem(botTree, folderName)) {
fail("folder was not found");
}
});
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project dsl-devkit by dsldevkit.
the class AbstractOutlineViewTest method openOutlineViewOfActiveEditor.
/**
* Opens the outline view of the currently active editor.
*
* @return the {@link SWTBotView} representing the outline view
* @throw WidgetNotFoundException if there is no active editor
*/
// CHECKSTYLE:CONSTANTS-OFF
protected SWTBotView openOutlineViewOfActiveEditor() {
getBot().menu("Window").menu("Show View").menu("Outline").click();
SWTBotView outlineView = getBot().viewById("org.eclipse.ui.views.ContentOutline");
assertNotNull("outline view present", outlineView);
SwtBotViewUtil.waitUntilViewIsLoaded(outlineView);
outlineView.setFocus();
return outlineView;
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project eclipse-integration-commons by spring-projects.
the class SWTBotUtils method selectProject.
/**
* Selects a project in the currently opened view. A view must be opened
* prior to using this method.
*
* @param projectName
* @return
*/
public static SWTBotTree selectProject(SWTWorkbenchBot bot, String projectName, String viewName) {
SWTBotView explorer = getView(bot, viewName);
SWTBotTree tree = explorer.bot().tree();
if (projectName != null) {
tree.select(projectName);
waitForSelection(bot, projectName, tree);
return tree;
} else {
tree.select(new String[0]);
waitForSelection(bot, "", tree);
return tree;
}
}
Aggregations