Author: dmaliarevich
Date: 2011-11-24 08:29:45 -0500 (Thu, 24 Nov 2011)
New Revision: 36616
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide10020_TestHotKeyForVpeRefresh.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10020 - Test for "Hot key for VPE refresh"
was added.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-11-24
13:03:27 UTC (rev 36615)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-11-24
13:29:45 UTC (rev 36616)
@@ -70,6 +70,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.VirtualEarthTagTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE9445Test_DuplicateSourceMenu;
+import org.jboss.tools.vpe.ui.bot.test.jbide.Jbide10020_TestHotKeyForVpeRefresh;
import org.jboss.tools.vpe.ui.bot.test.jbide.Jbide9827_TestNPEinHugeFile;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ImportTagsFromTLDFileTest;
@@ -178,7 +179,8 @@
XhtmlFilePerformanceTest.class,
MarkersTest.class,
JBIDE9445Test_DuplicateSourceMenu.class,
- Jbide9827_TestNPEinHugeFile.class
+ Jbide9827_TestNPEinHugeFile.class,
+ Jbide10020_TestHotKeyForVpeRefresh.class
})
public class VPEAllBotTests extends SWTBotTestCase{
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide10020_TestHotKeyForVpeRefresh.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide10020_TestHotKeyForVpeRefresh.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide10020_TestHotKeyForVpeRefresh.java 2011-11-24
13:29:45 UTC (rev 36616)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.jbide;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class Jbide10020_TestHotKeyForVpeRefresh extends VPEAutoTestCase {
+
+ private final String TOOL_TIP = "Refresh (F5)"; //$NON-NLS-1$
+ private final String TOOL_TIP2 = "Refresh"; //$NON-NLS-1$
+ private final String ERROR_MESSAGE =
+ "Could not find tool bar button with tooltip '" + TOOL_TIP
//$NON-NLS-1$
+ + "' on the toolbar. Hot key 'F5' for VPE refresh is broken.";
//$NON-NLS-1$
+
+ public Jbide10020_TestHotKeyForVpeRefresh() {
+ super();
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+ public void testHotKeyForVpeRefresh() {
+ SWTBotEditor editor = SWTTestExt.packageExplorer.openFile(
+ JBT_TEST_PROJECT_NAME, "WebContent", "pages", TEST_PAGE);
//$NON-NLS-1$ //$NON-NLS-2$
+ /*
+ * Case 1:
+ * When focus is on in the VPE --
+ * Find "Refresh (F5)" toolbar button
+ */
+ editor.setFocus();
+ try {
+ bot.toolbarButtonWithTooltip(TOOL_TIP);
+ } catch (Exception e) {
+ fail(ERROR_MESSAGE);
+ }
+ /*
+ * Case 2:
+ * When focus is on in Package Explorer --
+ * Find "Refresh" toolbar button without HotKey defined.
+ */
+ packageExplorer.show();
+ try {
+ bot.toolbarButtonWithTooltip(TOOL_TIP2);
+ } catch (Exception e) {
+ fail("Hot key for VPE refresh is *NOT* disabled in Package Explorer");
//$NON-NLS-1$
+ }
+ }
+}