Author: vpakan(a)redhat.com
Date: 2010-11-10 11:45:43 -0500 (Wed, 10 Nov 2010)
New Revision: 26422
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added Substituted EL Exressions Test
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-10
16:36:17 UTC (rev 26421)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-10
16:45:43 UTC (rev 26422)
@@ -154,6 +154,7 @@
public static final String USER_SPECIFIED_TAG_TEMPLATE = "User specified tag
template";
public static final String PAGE_DESIGN_OPTIONS = "Page Design Options";
public static final String ADD_TAGLIB_REFRENCE = "Add Taglib Reference";
+ public static final String ADD_EL_REFERENCE = "Add EL Reference";
}
public class EntityGroup {
@@ -603,7 +604,10 @@
public static final String INCLUDED_TAG_LIBS_TAB = "Included tag libs";
public static final String INCLUDED_TAG_LIBS_URI = "URI*";
public static final String INCLUDED_TAG_LIBS_PREFIX = "Prefix";
-
+
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_TAB = "Substituted EL
expressions";
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_EL_NAME = "El
Name*";
+ public static final String SUBSTITUTED_EL_EXPRESSIONS_VALUE = "Value";
}
public static class AddTaglibReferenceDialog{
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 2010-11-10
16:36:17 UTC (rev 26421)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-10
16:45:43 UTC (rev 26422)
@@ -15,6 +15,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.XhtmlFilePerformanceTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.AddSubstitutedELExpressionFolderScopeTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.IncludedTagLibsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.SubstitutedELExressionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.ToolbarTextFormattingTest;
import
org.jboss.tools.vpe.ui.bot.test.editor.preferences.AlwaysHideSelectionBarWithoutPromptTest;
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.BorderForUnknownTagsTest;
@@ -76,6 +77,7 @@
suite.addTestSuite(TextEditingActionsTest.class);
suite.addTestSuite(PromptForTagAttributesDuringTagInsertTest.class);
suite.addTestSuite(IncludedTagLibsTest.class);
+ suite.addTestSuite(SubstitutedELExressionsTest.class);
return new TestSetup(suite);
}
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java 2010-11-10
16:45:43 UTC (rev 26422)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 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.editor.pagedesign;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+/**
+ * Tests functionality of Substituted EL Expressions tab page of Page Design Options
Dialog
+ * @author vlado pakan
+ *
+ */
+public class SubstitutedELExressionsTest extends PageDesignTestCase {
+
+ private SWTBot addELReferenceDialogBot = null;
+ private SWTBot optionsDialogBot = null;
+ private SWTBot editELReferenceDialogBot = null;
+
+ public void testIncludedTagLibs(){
+ openPage();
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+
optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_TAB).activate();
+ optionsDialogBot.button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
+ addELReferenceDialogBot =
optionsDialogBot.shell(IDELabel.Shell.ADD_EL_REFERENCE).activate().bot();
+ SWTBotText txMessage = addELReferenceDialogBot.text(2);
+ SWTBotText txValue =
addELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_VALUE);
+ SWTBotText txName =
addELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_EL_NAME);
+ // Tests default message
+ final String defaultMessage = txMessage.getText();
+ final String defaultMessageStartsWith = "Add El variable";
+ assertTrue("Default Dialog Message has to start with '" +
defaultMessageStartsWith + "' but is: " + defaultMessage,
+ defaultMessage.startsWith(defaultMessageStartsWith));
+ // Tests properly set Value
+ final String testName = "page.consist";
+ txName.setText(testName);
+ assertTrue("Dialog Message has to be '" + defaultMessage + "'
but is: " + txMessage.getText(),
+ txMessage.getText().equals(defaultMessage));
+ // Tests incorrect name message
+ txName.setText(testName + " error");
+ final String invalidELNameMessage = " Invalid EL expression.";
+ assertTrue("Dialog Message has to be '" + invalidELNameMessage +
"' but is: " + txMessage.getText(),
+ txMessage.getText().equals(invalidELNameMessage));
+ // Tests properly set Name and Value
+ txName.setText(testName);
+ final String testValue = "test value";
+ txValue.setText(testValue);
+ assertTrue("Dialog Message has to be '" + defaultMessage + "'
but is: " + txMessage.getText(),
+ txMessage.getText().equals(defaultMessage));
+ addELReferenceDialogBot.button(IDELabel.Button.FINISH).click();
+ addELReferenceDialogBot = null;
+ // Reopens dialog and tests saved values
+ optionsDialogBot.button(IDELabel.Button.EDIT_WITHOUT_DOTS).click();
+ editELReferenceDialogBot =
optionsDialogBot.shell(IDELabel.Shell.ADD_EL_REFERENCE).activate().bot();
+ txMessage = editELReferenceDialogBot.text(2);
+ txName =
editELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_EL_NAME);
+ txValue =
editELReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.SUBSTITUTED_EL_EXPRESSIONS_VALUE);
+ assertTrue("Dialog Message has to be '" + defaultMessage + "'
but is: " + txMessage.getText(),
+ txMessage.getText().equals(defaultMessage));
+ assertTrue("Value has to be'" + testValue + "' but is: "
+ txValue.getText(),
+ txValue.getText().equals(testValue));
+ assertTrue("Name value has to be'" + testName + "' but is:
" + txName.getText(),
+ txName.getText().equals(testName));
+ editELReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ editELReferenceDialogBot = null;
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ if (addELReferenceDialogBot != null){
+ addELReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ addELReferenceDialogBot = null;
+ }
+ if (editELReferenceDialogBot != null){
+ editELReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ editELReferenceDialogBot = null;
+ }
+ if (optionsDialogBot != null){
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return optionsDialogBot != null
+ || addELReferenceDialogBot != null
+ || editELReferenceDialogBot != null;
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain