From 4c879313cd1332e594b1ad20b1485bdff9533034 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 4 Feb 2011 01:08:22 +0100 Subject: Fix create and rename branch ui tests The branch dialogs were improved but the corresponding tests were not adapted appropriately. Signed-off-by: Matthias Sohn Change-Id: I7f92be2c0ab44d001946ec75334d881820109a5d --- .../team/actions/BranchAndResetActionTest.java | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java index 22b3202227..41a4a0ef58 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java @@ -58,6 +58,7 @@ import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.utils.TableCollection; import org.eclipse.swtbot.swt.finder.waits.ICondition; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; import org.eclipse.swtbot.swt.finder.widgets.TimeoutException; @@ -306,12 +307,13 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase { SWTBotShell dialog = openBranchDialog(); dialog.bot().button(UIText.BranchSelectionDialog_NewBranch).click(); SWTBotShell branchNameDialog = bot - .shell(UIText.BranchSelectionDialog_QuestionNewBranchTitle); - branchNameDialog.bot().text().setText("master"); - assertFalse(branchNameDialog.bot().button(IDialogConstants.OK_LABEL) + .shell(UIText.CreateBranchWizard_NewBranchTitle); + SWTBotText branchName = bot.textWithId("BranchName"); + branchName.setText("master"); + assertFalse(branchNameDialog.bot().button(IDialogConstants.FINISH_LABEL) .isEnabled()); - branchNameDialog.bot().text().setText("NewBranch"); - branchNameDialog.bot().button(IDialogConstants.OK_LABEL).click(); + branchName.setText("NewBranch"); + branchNameDialog.bot().button(IDialogConstants.FINISH_LABEL).click(); assertEquals("New Branch should be selected", "NewBranch", bot.tree() .selection().get(0, 0)); @@ -351,12 +353,13 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase { SWTBotShell dialog = openBranchDialog(); dialog.bot().button(UIText.BranchSelectionDialog_NewBranch).click(); SWTBotShell branchNameDialog = bot - .shell(UIText.BranchSelectionDialog_QuestionNewBranchTitle); - branchNameDialog.bot().text().setText("master"); - assertFalse(branchNameDialog.bot().button(IDialogConstants.OK_LABEL) + .shell(UIText.CreateBranchWizard_NewBranchTitle); + SWTBotText branchName = bot.textWithId("BranchName"); + branchName.setText("master"); + assertFalse(branchNameDialog.bot().button(IDialogConstants.FINISH_LABEL) .isEnabled()); - branchNameDialog.bot().text().setText("Unrenamed"); - branchNameDialog.bot().button(IDialogConstants.OK_LABEL).click(); + branchName.setText("Unrenamed"); + branchNameDialog.bot().button(IDialogConstants.FINISH_LABEL).click(); assertEquals("New Branch should be selected", "Unrenamed", bot.tree() .selection().get(0, 0)); -- cgit v1.2.3