String previous = rw.parseCommit(repo.resolve("HEAD")).name();
touchAndSubmit(null);
SWTBotShell pushDialog = openPushDialog();
SWTBotCombo destinationCombo = pushDialog.bot().comboBox();
String[] items = destinationCombo.items();
for (int i = 0; i < items.length; i++) {
if (items[i].startsWith(destination))
destinationCombo.setSelection(i);
}
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
if (withConfirmPage)
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
SWTBotShell confirm = bot.shell(NLS.bind(UIText.PushResultDialog_title,
destination));
String result = confirm.bot().tree().getAllItems()[0].getText();
assertTrue("Wrong result", result.contains(previous.substring(0, 7)));
confirm.close();
pushDialog = openPushDialog();
destinationCombo = pushDialog.bot().comboBox();
for (int i = 0; i < items.length; i++) {
if (items[i].startsWith(destination))
destinationCombo.setSelection(i);
}
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
if (withConfirmPage)
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();