use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class CommitNonWSChangesTest method clickOnCommit.
private void clickOnCommit() throws Exception {
SWTBotView repoView = TestUtil.showView(RepositoriesView.VIEW_ID);
TestUtil.joinJobs(JobFamilies.REPO_VIEW_REFRESH);
SWTBotTree tree = repoView.bot().tree();
TestUtil.waitUntilTreeHasNodeContainsText(bot, tree, REPO1, 10000);
tree.getAllItems()[0].contextMenu("Commit...").click();
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class SynchronizeViewPushTest method shouldUpdateTrackingBranchOnPush.
@Test
public void shouldUpdateTrackingBranchOnPush() throws Exception {
makeChangesAndCommit(PROJ1);
Repository repository = lookupRepository(repositoryFile);
ObjectId headId = repository.resolve(Constants.HEAD);
String trackingBranch = Constants.R_REMOTES + "origin/master";
launchSynchronization(Constants.HEAD, trackingBranch, false);
SWTBotView viewBot = bot.viewById(ISynchronizeView.VIEW_ID);
SWTBotToolbarButton pushButton = viewBot.toolbarButton(UIText.GitActionContributor_Push);
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.PUSH, 30, TimeUnit.SECONDS);
pushButton.click();
TestUtil.openJobResultDialog(jobJoiner.join());
String destinationString = repositoryFile.getParentFile().getName() + " - " + "origin";
SWTBotShell resultDialog = bot.shell(NLS.bind(UIText.PushResultDialog_title, destinationString));
resultDialog.close();
Repository remoteRepository = lookupRepository(childRepositoryFile);
ObjectId masterOnRemote = remoteRepository.resolve("master");
assertThat("Expected push to update branch on remote repository", masterOnRemote, is(headId));
ObjectId trackingId = repository.resolve(trackingBranch);
assertThat("Expected tracking branch to be updated", trackingId, is(headId));
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class ShowInTest method testOpenHistory.
@Test
public void testOpenHistory() throws Exception {
try {
SWTBotView view = bot.viewById(IHistoryView.VIEW_ID);
view.close();
} catch (Exception e) {
// ignore
}
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
getProjectItem(projectExplorerTree, PROJ1).select();
String menuString = util.getPluginLocalizedValue("ShowResourceInHistoryAction_label");
ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Team", menuString);
bot.viewById(IHistoryView.VIEW_ID).close();
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class DynamicVariablesTest method assertVariable.
private void assertVariable(String expected, String variableName, String argument) throws CoreException {
IResource findMember = project.findMember(TEST_FILE);
SWTBotView explorerView = TestUtil.showExplorerView();
final ISelectionProvider selectionProvider = explorerView.getViewReference().getView(true).getSite().getSelectionProvider();
final StructuredSelection structuredSelection = new StructuredSelection(findMember);
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
selectionProvider.setSelection(structuredSelection);
}
});
IDynamicVariable dynamicVariable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable(variableName);
String value = dynamicVariable.getValue(argument);
assertEquals(expected, value);
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView in project egit by eclipse.
the class HistoryViewTest method toggleShowAllBranchesButton.
private void toggleShowAllBranchesButton(boolean checked) throws Exception {
getHistoryViewTable(PROJ1);
SWTBotView view = bot.viewById(IHistoryView.VIEW_ID);
SWTBotToolbarToggleButton showAllBranches = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_showAllBranches);
boolean isChecked = showAllBranches.isChecked();
if (isChecked && !checked || !isChecked && checked)
showAllBranches.click();
}
Aggregations