[jbosstools-commits] JBoss Tools SVN: r42647 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test: wizard and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Jul 19 05:43:36 EDT 2012


Author: vpakan at redhat.com
Date: 2012-07-19 05:43:36 -0400 (Thu, 19 Jul 2012)
New Revision: 42647

Modified:
   trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CodeCompletionTest.java
   trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
Log:
Fixes for JBT 3.3.1.

Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CodeCompletionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CodeCompletionTest.java	2012-07-19 09:19:13 UTC (rev 42646)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/CodeCompletionTest.java	2012-07-19 09:43:36 UTC (rev 42647)
@@ -109,7 +109,7 @@
         "  <head>\n" +
         "  </head>\n" +
         "  <body>\n" +
-        "  </boyd>\n" +
+        "  </body>\n" +
         "</html>");
     bot.sleep(Timing.time2S());
     final String tagToSelect = "<body>";

Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java	2012-07-19 09:19:13 UTC (rev 42646)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java	2012-07-19 09:43:36 UTC (rev 42647)
@@ -22,6 +22,7 @@
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
 import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
 import org.jboss.tools.jst.jsp.messages.JstUIMessages;
 import org.jboss.tools.ui.bot.ext.SWTJBTExt;
@@ -86,14 +87,12 @@
 		 * Select some text
 		 */
 		editor.toTextEditor().selectRange(7, 18, 4);
-		util.waitForAll();
 		/*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, bot
-				.toolbarButtonWithTooltip(TOOL_TIP)
-				.isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+    util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+    tbButton.click();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
@@ -181,10 +180,9 @@
 		/*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, bot
-				.toolbarButtonWithTooltip(TOOL_TIP)
-				.isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+		tbButton.click();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
@@ -228,13 +226,13 @@
 		 * Select some text
 		 */
 		editor.toTextEditor().selectRange(7, 18, 4);
-		assertEquals("Replaced text is incorrect", "User", editor.toTextEditor().getSelection()); //$NON-NLS-1$ //$NON-NLS-2$
+    assertEquals("Replaced text is incorrect", "User", editor.toTextEditor().getSelection()); //$NON-NLS-1$ //$NON-NLS-2$
 		/*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, 
-				bot.toolbarButtonWithTooltip(TOOL_TIP).isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+    tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+    util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+    tbButton.click();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
@@ -285,13 +283,12 @@
 		 * Select some text
 		 */
 		editor.toTextEditor().selectRange(7, 18, 4);
-		util.waitForAll();
-		/*
+    /*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, bot
-				.toolbarButtonWithTooltip(TOOL_TIP).isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+    tbButton.click();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
@@ -371,11 +368,10 @@
 		/*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, bot
-				.toolbarButtonWithTooltip(TOOL_TIP)
-				.isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
-		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+    tbButton.click();
+    bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
 		
@@ -482,19 +478,18 @@
 		 * Select some text
 		 */
 		editor.toTextEditor().selectRange(13, 15, 1);
-		util.waitForAll();
 		/*
 		 * There is an exception caused by the fact that
 		 * line delimiter was selected.
 		 * But for this test it's ok, so just ignore this exception.
 		 */
 		setException(null);
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitWhileToolbarButtonisDisabled(tbButton,Timing.time5S());
 		/*
-		 * Check that the toolbar buttion is disabled
+		 * Check that the toolbar button is disabled
 		 */
-		assertFalse("Toolbar button should be disabled", bot //$NON-NLS-1$
-				.toolbarButtonWithTooltip(TOOL_TIP)
-				.isEnabled());
+	  assertFalse("Toolbar button should be disabled", tbButton.isEnabled());
 		/*
 		 * Select some text
 		 */
@@ -507,9 +502,9 @@
 		/*
 		 * Activate the dialog
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED,
-				bot.toolbarButtonWithTooltip(TOOL_TIP).isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+		tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitWhileToolbarButtonisDisabled(tbButton,Timing.time5S());
+    tbButton.click();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
@@ -926,11 +921,10 @@
 		/*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, bot
-				.toolbarButtonWithTooltip(TOOL_TIP)
-				.isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
-		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+    tbButton.click();
+    bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
 		SWTBotCheckBox checkBox = bot.checkBox();
@@ -1033,10 +1027,9 @@
 		/*
 		 * Get toolbar button
 		 */
-		assertTrue(TOOLBAR_ICON_ENABLED, bot
-				.toolbarButtonWithTooltip(TOOL_TIP)
-				.isEnabled());
-		bot.toolbarButtonWithTooltip(TOOL_TIP).click();
+		SWTBotToolbarButton tbButton = bot.toolbarButtonWithTooltip(TOOL_TIP);
+		util.waitForToolbarButtonEnabled(tbButton,Timing.time5S());
+    tbButton.click();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).setFocus();
 		bot.shell(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE).activate();
 		isUnusedDialogOpened = true;
@@ -1074,5 +1067,6 @@
 		bot.button(WidgetVariables.NEXT_BUTTON).click();
 	
 		return editor;
-	}	
+	}
+
 }
\ No newline at end of file



More information about the jbosstools-commits mailing list