use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project egit by eclipse.
the class FetchAndMergeActionTest method mergeBranch.
private void mergeBranch(String branchToMerge, boolean squash) throws Exception {
SWTBotShell mergeDialog = openMergeDialog();
TestUtil.navigateTo(mergeDialog.bot().tree(), new String[] { LOCAL_BRANCHES, branchToMerge }).select();
if (squash)
mergeDialog.bot().radio(UIText.MergeTargetSelectionDialog_MergeTypeSquashButton).click();
mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click();
bot.shell(UIText.MergeAction_MergeResultTitle).close();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project egit by eclipse.
the class FetchAndMergeActionTest method testFetchFromOriginThenMerge.
@Test
public void testFetchFromOriginThenMerge() throws Exception {
touchAndSubmit(null);
deleteAllProjects();
shareProjects(childRepositoryFile);
String oldContent = getTestFileContent();
fetch();
final String title = NLS.bind(UIText.FetchResultDialog_title, childRepositoryFile.getParentFile().getName() + " - origin");
bot.waitUntil(Conditions.shellIsActive(title));
SWTBotShell confirm = bot.shell(title);
SWTBotTree tree = confirm.bot().tree();
String branch = tree.getAllItems()[0].getText();
assertTrue("Wrong result", branch.contains(initialCommitId.substring(0, 7)));
confirm.close();
String newContent = getTestFileContent();
assertEquals(oldContent, newContent);
fetch();
bot.waitUntil(Conditions.shellIsActive(title));
confirm = bot.shell(title);
int count = confirm.bot().tree().rowCount();
confirm.close();
assertEquals("Wrong result count", 0, count);
newContent = getTestFileContent();
assertEquals(oldContent, newContent);
SWTBotShell mergeDialog = openMergeDialog();
SWTBotTreeItem remoteBranches = TestUtil.expandAndWait(mergeDialog.bot().tree().getTreeItem(REMOTE_BRANCHES));
TestUtil.getChildNode(remoteBranches, "origin/master").select();
mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click();
bot.shell(UIText.MergeAction_MergeResultTitle).close();
newContent = getTestFileContent();
assertFalse(oldContent.equals(newContent));
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project egit by eclipse.
the class FetchAndMergeActionTest method openMergeDialog.
private SWTBotShell openMergeDialog() throws Exception {
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
getProjectItem(projectExplorerTree, PROJ1).select();
String menuString = util.getPluginLocalizedValue("MergeAction_label");
ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team", menuString);
Repository repo = lookupRepository(childRepositoryFile);
SWTBotShell dialog = bot.shell(NLS.bind(UIText.MergeTargetSelectionDialog_TitleMergeWithBranch, repo.getBranch()));
return dialog;
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project egit by eclipse.
the class FetchAndMergeActionTest method createNewBranch.
private void createNewBranch(String newBranch, boolean checkout) {
SWTBotShell newBranchDialog = openCreateBranchDialog();
newBranchDialog.bot().textWithId("BranchName").setText(newBranch);
if (!checkout)
newBranchDialog.bot().checkBox(UIText.CreateBranchPage_CheckoutButton).deselect();
newBranchDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell 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));
}
Aggregations